remove duplicate scope definition
scope can be defined both within the strategy declaration or when invoking passport
This commit is contained in:
parent
6be38bcefd
commit
1c18b4c6ac
|
@ -110,8 +110,7 @@ exports.strategyFactory = async function (config, callbackUrl) {
|
||||||
userInfoURL: body.userinfo_endpoint,
|
userInfoURL: body.userinfo_endpoint,
|
||||||
clientID: clientId,
|
clientID: clientId,
|
||||||
clientSecret: clientSecret,
|
clientSecret: clientSecret,
|
||||||
callbackURL: callbackUrl,
|
callbackURL: callbackUrl
|
||||||
scope: "profile email",
|
|
||||||
},
|
},
|
||||||
authenticate
|
authenticate
|
||||||
)
|
)
|
||||||
|
|
|
@ -153,6 +153,7 @@ exports.oidcPreAuth = async (ctx, next) => {
|
||||||
const strategy = await oidcStrategyFactory(ctx)
|
const strategy = await oidcStrategyFactory(ctx)
|
||||||
|
|
||||||
return passport.authenticate(strategy, {
|
return passport.authenticate(strategy, {
|
||||||
|
// required 'openid' scope is added by oidc strategy factory
|
||||||
scope: ["profile", "email"],
|
scope: ["profile", "email"],
|
||||||
})(ctx, next)
|
})(ctx, next)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue