mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00: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:
		| @@ -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 | ||||||
|     ); |     ); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user