Skip to content

Node.js based forum software built for the modern web

filter:auth.init strategy extension with custom urls

APXEOLOG10bbbb894205
diff --git a/src/routes/authentication.js b/src/routes/authentication.js
index b18038eeb0..53a02a833c 100644
--- a/src/routes/authentication.js
+++ b/src/routes/authentication.js
@@ -57,8 +57,8 @@
}
router.get(strategy.callbackURL, passport.authenticate(strategy.name, {
- successReturnToOrRedirect: nconf.get('relative_path') + '/',
- failureRedirect: nconf.get('relative_path') + '/login'
+ successReturnToOrRedirect: nconf.get('relative_path') + (strategy.successUrl !== undefined ? strategy.successUrl : '/'),
+ failureRedirect: nconf.get('relative_path') + (strategy.failureUrl !== undefined ? strategy.failureUrl : '/login')
}));
});