From 9e1f72a4355713ca118478cd62ee3c810350ed74 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 27 Mar 2021 22:21:27 -0400 Subject: [PATCH] feat: optional urlMethod param for loginStrategies --- src/routes/authentication.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 5ff5716478..b8373296cf 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -98,7 +98,7 @@ Auth.reloadRoutes = async function (params) { loginStrategies = loginStrategies || []; loginStrategies.forEach((strategy) => { if (strategy.url) { - router.get(strategy.url, Auth.middleware.applyCSRF, async (req, res, next) => { + router[strategy.urlMethod || 'get'](strategy.url, Auth.middleware.applyCSRF, async (req, res, next) => { let opts = { scope: strategy.scope, prompt: strategy.prompt || undefined, @@ -111,7 +111,6 @@ Auth.reloadRoutes = async function (params) { // Allow SSO plugins to override/append options (for use in passport prototype authorizationParams) ({ opts } = await plugins.hooks.fire('filter:auth.options', { req, res, opts })); - passport.authenticate(strategy.name, opts)(req, res, next); }); }