diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 1f26c23980..c2b238f7d5 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -67,7 +67,7 @@ Auth.reloadRoutes = async function (params) { loginStrategies.forEach(function (strategy) { if (strategy.url) { router.get(strategy.url, Auth.middleware.applyCSRF, function (req, res, next) { - req.session.ssoState = req.csrfToken(); + req.session.ssoState = req.csrfToken && req.csrfToken(); passport.authenticate(strategy.name, { scope: strategy.scope, prompt: strategy.prompt || undefined,