mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 10:35:55 +01:00
fixes #4840
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user