Skip to content

Commit

Permalink
Merge pull request #37 from feathersjs/auth-prop
Browse files Browse the repository at this point in the history
Fix old property name fallback for backwards compatibility
  • Loading branch information
marshallswain authored and daffl committed Aug 28, 2018
1 parent bb81f28 commit 93f65d7
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 21 deletions.
130 changes: 112 additions & 18 deletions packages/authentication-oauth2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/authentication-oauth2/src/express/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const debug = Debug('feathers-authentication-oauth2:handler');
export default function OAuthHandler (options = {}) {
return function (req, res, next) {
const app = req.app;
const authSettings = app.get('authentication') || {};
const authSettings = app.get('auth') || app.get('authentication') || {};
const entity = req[options.entity];
const payload = req.payload;
const params = {
Expand Down
3 changes: 1 addition & 2 deletions packages/authentication-oauth2/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Debug from 'debug';
import url from 'url';
import auth from 'feathers-authentication';
import { formatter as defaultFormatter } from 'feathers-rest';
import { omit, pick, makeUrl } from 'feathers-commons';
Expand Down Expand Up @@ -38,7 +37,7 @@ export default function init (options = {}) {
throw new Error(`You must provide a passport 'Strategy' instance.`);
}

const authSettings = app.get('authentication') || {};
const authSettings = app.get('auth') || app.get('authentication') || {};

// Attempt to pull options from the global auth config
// for this provider.
Expand Down

0 comments on commit 93f65d7

Please sign in to comment.