This commit is contained in:
Julian Lam
2016-07-12 11:39:51 -04:00
parent cb435351b2
commit 03208807e4

View File

@@ -118,9 +118,13 @@ Controllers.login = function(req, res, next) {
data.title = '[[pages:login]]';
if (!data.allowLocalLogin && !data.allowRegistration && data.alternate_logins && data.authentication.length === 1) {
return helpers.redirect(res, {
external: data.authentication[0].url
});
if (res.locals.isAPI) {
return helpers.redirect(res, {
external: data.authentication[0].url
});
} else {
return res.redirect(data.authentication[0].url);
}
}
if (req.uid) {
user.getUserFields(req.uid, ['username', 'email'], function(err, user) {