mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow oauth strategy callback method to be customised
Closes #1998 Method can be set via: `adminAuth.strategy.options.callbackMethod` Can be either GET (default) or POST.
This commit is contained in:
parent
978f4ecc58
commit
a1f135bd66
@ -182,7 +182,12 @@ function genericStrategy(adminApp,strategy) {
|
|||||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||||
completeGenerateStrategyAuth
|
completeGenerateStrategyAuth
|
||||||
);
|
);
|
||||||
adminApp.get('/auth/strategy/callback',
|
|
||||||
|
var callbackMethodFunc = adminApp.get;
|
||||||
|
if (/^post$/i.test(options.callbackMethod)) {
|
||||||
|
callbackMethodFunc = adminApp.post;
|
||||||
|
}
|
||||||
|
callbackMethodFunc('/auth/strategy/callback',
|
||||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||||
completeGenerateStrategyAuth
|
completeGenerateStrategyAuth
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user