Skip to content

Node.js based forum software built for the modern web

feat: optional urlMethod param for loginStrategies

psychobunny9e1f72a43557
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);
});
}