Skip to content

Commit

Permalink
Rename repository and use npm scope (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Aug 28, 2018
1 parent c1337fc commit c6121d1
Show file tree
Hide file tree
Showing 9 changed files with 568 additions and 532 deletions.
2 changes: 1 addition & 1 deletion packages/authentication-oauth1/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_js:
- '6'
addons:
code_climate:
repo_token: e9df6da1efb4ae199a7f1dd2a683b8d13a9d03411e269840244b43b563a3e5fe
repo_token: 0c2f880b36167bdacf81124fc4b98c9f280e9aa0092e46616a0612003ac40bdf
notifications:
email: false
slack:
Expand Down
26 changes: 12 additions & 14 deletions packages/authentication-oauth1/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
# feathers-authentication-oauth1
# @feathersjs/authentication-oauth1

[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/feathers-authentication-oauth1.svg)](https://greenkeeper.io/)
[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/authentication-oauth1.svg)](https://greenkeeper.io/)

[![Build Status](https://travis-ci.org/feathersjs/feathers-authentication-oauth1.png?branch=master)](https://travis-ci.org/feathersjs/feathers-authentication-oauth1)
[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth1/badges/gpa.svg)](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth1)
[![Test Coverage](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth1/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth1/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers-authentication-oauth1.svg?style=flat-square)](https://david-dm.org/feathersjs/feathers-authentication-oauth1)
[![Download Status](https://img.shields.io/npm/dm/feathers-authentication-oauth1.svg?style=flat-square)](https://www.npmjs.com/package/feathers-authentication-oauth1)
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com)
[![Build Status](https://travis-ci.org/feathersjs/authentication-oauth1.png?branch=master)](https://travis-ci.org/feathersjs/authentication-oauth1)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c8bd6a04ca7085e78e5f/test_coverage)](https://codeclimate.com/github/feathersjs/authentication-oauth1/test_coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/authentication-oauth1.svg?style=flat-square)](https://david-dm.org/feathersjs/authentication-oauth1)
[![Download Status](https://img.shields.io/npm/dm/@feathersjs/authentication-oauth1.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/authentication-oauth1)

> A Feathers OAuth1 authentication strategy
## Installation

```
npm install feathers-authentication-oauth1 --save
npm install @feathersjs/authentication-oauth1 --save
```

**Note:** This is only compatibile with `[email protected]` and above.

## Documentation

Please refer to the [feathers-authentication-oauth1 documentation](http://docs.feathersjs.com/) for more details.
Please refer to the [@feathersjs/authentication-oauth1 documentation](http://docs.feathersjs.com/) for more details.

## Supported Strategies

Expand All @@ -36,7 +34,7 @@ This module contains 2 core pieces:

### Main Initialization

In most cases initializing the `feathers-authentication-oauth1` module is as simple as doing this:
In most cases initializing the `@feathersjs/authentication-oauth1` module is as simple as doing this:

```js
const session = require('express-session');
Expand Down Expand Up @@ -94,7 +92,7 @@ The `Verifier` class can be extended so that you customize it's behavior without
An example of customizing the Verifier:
```js
import oauth1, { Verifier } from 'feathers-authentication-oauth1';
import oauth1, { Verifier } from '@feathersjs/authentication-oauth1';

class CustomVerifier extends Verifier {
// The verify function has the exact same inputs and
Expand Down Expand Up @@ -167,7 +165,7 @@ app.service('users').hooks({
## Complete Example
Here's a basic example of a Feathers server that uses `feathers-authentication-oauth1`. You can see a fully working example in the [example/](./example/) directory.
Here's a basic example of a Feathers server that uses `@feathersjs/authentication-oauth1`. You can see a fully working example in the [example/](./example/) directory.
**Note:** You must setup some session middleware. OAuth1 strategies rely on sessions in order to authenticate.
Expand All @@ -181,7 +179,7 @@ const session = require('express-session');
const TwitterStrategy = require('passport-twitter').Strategy;
const errorHandler = require('feathers-errors/handler');
const auth = require('feathers-authentication');
const oauth1 = require('feathers-authentication-oauth1');
const oauth1 = require('@feathersjs/authentication-oauth1');

// Initialize the application
const app = feathers()
Expand Down
4 changes: 2 additions & 2 deletions packages/authentication-oauth1/example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# feathers-authentication-oauth1 Example
# @feathersjs/authentication-oauth1 Example

This provides a complete working example on how to use `feathers-authentication-oauth1` to provide Twitter authentication and get a JWT access token in return.
This provides a complete working example on how to use `@feathersjs/authentication-oauth1` to provide Twitter authentication and get a JWT access token in return.

1. Create an application on Twitter

Expand Down
2 changes: 1 addition & 1 deletion packages/authentication-oauth1/lib/express/handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Debug = require('debug');

const debug = Debug('feathers-authentication-oauth1:handler');
const debug = Debug('@feathersjs/authentication-oauth1:handler');

module.exports = function OAuthHandler (options = {}) {
return function (req, res, next) {
Expand Down
4 changes: 2 additions & 2 deletions packages/authentication-oauth1/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const merge = require('lodash.merge');
const defaultHandler = require('./express/handler');
const DefaultVerifier = require('./verifier');

const debug = Debug('feathers-authentication-oauth1');
const debug = Debug('@feathersjs/authentication-oauth1');

const INCLUDE_KEYS = [
'entity',
Expand All @@ -28,7 +28,7 @@ module.exports = function init (options = {}) {
const _super = app.setup;

if (!app.passport) {
throw new Error(`Can not find app.passport. Did you initialize feathers-authentication before feathers-authentication-oauth1?`);
throw new Error(`Can not find app.passport. Did you initialize feathers-authentication before @feathersjs/authentication-oauth1?`);
}

let { name, Strategy } = options;
Expand Down
4 changes: 2 additions & 2 deletions packages/authentication-oauth1/lib/verifier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Debug = require('debug');

const debug = Debug('feathers-authentication-oauth1:verify');
const debug = Debug('@feathersjs/authentication-oauth1:verify');

class OAuth1Vierifier {
constructor (app, options = {}) {
Expand All @@ -9,7 +9,7 @@ class OAuth1Vierifier {
this.service = typeof options.service === 'string' ? app.service(options.service) : options.service;

if (!this.service) {
throw new Error(`options.service does not exist.\n\tMake sure you are passing a valid service path or service instance and it is initialized before feathers-authentication-oauth1.`);
throw new Error(`options.service does not exist.\n\tMake sure you are passing a valid service path or service instance and it is initialized before @feathersjs/authentication-oauth1.`);
}

this._createEntity = this._createEntity.bind(this);
Expand Down
Loading

0 comments on commit c6121d1

Please sign in to comment.