fix issue where an auto-redirect to SSO on login route was failing if invoked via API call (ajaxify)

This commit is contained in:
Julian Lam
2017-03-07 14:35:38 -05:00
parent 8a123f7c1c
commit 1102ca8ebb

View File

@@ -131,7 +131,7 @@ Controllers.login = function (req, res, next) {
if (!data.allowLocalLogin && !data.allowRegistration && data.alternate_logins && data.authentication.length === 1) { if (!data.allowLocalLogin && !data.allowRegistration && data.alternate_logins && data.authentication.length === 1) {
if (res.locals.isAPI) { if (res.locals.isAPI) {
return helpers.redirect(res, { return helpers.redirect(res, {
external: data.authentication[0].url, external: nconf.get('relative_path') + data.authentication[0].url,
}); });
} }
return res.redirect(nconf.get('relative_path') + data.authentication[0].url); return res.redirect(nconf.get('relative_path') + data.authentication[0].url);