Skip to content

Commit

Permalink
fix: crash if csrfToken does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 22, 2020
1 parent 6f889c9 commit a3c8d45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/authentication.js
Expand Up @@ -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,
Expand Down

0 comments on commit a3c8d45

Please sign in to comment.