Ability to pass OAuth callback dynamically

This commit is contained in:
Sajjad Shirazy 2019-08-26 10:41:50 +04:30 committed by GitHub
parent 8151c6b9c3
commit cc178e1cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,8 @@ module.exports = {
if (!_.get(config, 'enabled')) {
return ctx.badRequest(null, 'This provider is disabled.');
}
// Ability to pass OAuth callback dynamically
grantConfig[provider].callback = ctx.query && ctx.query.callback ? ctx.query.callback : grantConfig[provider].callback;
return grant(grantConfig)(ctx, next);
},