Skip to content

Commit

Permalink
Simplified redirectOptions (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsainaney authored and daffl committed Aug 28, 2018
1 parent 638655b commit 5ddf5a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/authentication-oauth2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function init (options = {}) {

// register OAuth middleware
debug(`Registering '${name}' Express OAuth middleware`);
app.get(oauth2Settings.path, auth.express.authenticate(name, oauth2Settings[name]));
app.get(oauth2Settings.path, auth.express.authenticate(name, oauth2Settings));
app.get(
oauth2Settings.callbackPath,
auth.express.authenticate(name, oauth2Settings),
Expand Down
10 changes: 5 additions & 5 deletions packages/authentication-oauth2/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ describe('feathers-authentication-oauth2', () => {

it('registers the redirect options on strategy options', () => {
sinon.spy(authentication.express, 'authenticate');

const mergedOptions = Object.assign({}, config, globalConfig)
const mergedOptions = Object.assign({}, config, globalConfig);
app.configure(oauth2(mergedOptions));
app.setup();
const strategyOptions = mergedOptions[config.name]
expect(authentication.express.authenticate).to.have.been.calledWith(config.name, strategyOptions);

delete mergedOptions.Strategy;
expect(authentication.express.authenticate).to.have.been.calledWith(config.name, sinon.match(mergedOptions));

authentication.express.authenticate.restore();
});
Expand Down

0 comments on commit 5ddf5a9

Please sign in to comment.