mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #4516
This commit is contained in:
@@ -70,6 +70,13 @@ $(document).ready(function() {
|
||||
if (err) {
|
||||
return onAjaxError(err, url, callback, quiet);
|
||||
}
|
||||
|
||||
if (window.history && window.history.pushState) {
|
||||
window.history[!quiet ? 'pushState' : 'replaceState']({
|
||||
url: url
|
||||
}, url, RELATIVE_PATH + '/' + url);
|
||||
}
|
||||
|
||||
retry = true;
|
||||
app.template = data.template.name;
|
||||
|
||||
@@ -104,12 +111,6 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
ajaxify.currentPage = url.split(/[?#]/)[0];
|
||||
|
||||
if (window.history && window.history.pushState) {
|
||||
window.history[!quiet ? 'pushState' : 'replaceState']({
|
||||
url: url
|
||||
}, url, RELATIVE_PATH + '/' + url);
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
|
||||
@@ -108,6 +108,12 @@ Controllers.login = function(req, res, next) {
|
||||
data.error = req.flash('error')[0];
|
||||
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
|
||||
});
|
||||
}
|
||||
|
||||
res.render('login', data);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user