Browse Source

remove duplicate scope definition

scope can be defined both within the strategy declaration or when invoking passport
master
Rory Powell 5 years ago
parent
commit
1c18b4c6ac
  1. 3
      packages/auth/src/middleware/passport/oidc.js
  2. 1
      packages/worker/src/api/controllers/admin/auth.js

3
packages/auth/src/middleware/passport/oidc.js

@ -110,8 +110,7 @@ exports.strategyFactory = async function (config, callbackUrl) {
userInfoURL: body.userinfo_endpoint,
clientID: clientId,
clientSecret: clientSecret,
callbackURL: callbackUrl,
scope: "profile email",
callbackURL: callbackUrl
},
authenticate
)

1
packages/worker/src/api/controllers/admin/auth.js

@ -153,6 +153,7 @@ exports.oidcPreAuth = async (ctx, next) => {
const strategy = await oidcStrategyFactory(ctx)
return passport.authenticate(strategy, {
// required 'openid' scope is added by oidc strategy factory
scope: ["profile", "email"],
})(ctx, next)
}

Loading…
Cancel
Save