This commit is contained in:
Julian Lam
2018-08-10 14:22:28 -04:00
parent e6ec041dde
commit a77630c6be
2 changed files with 5 additions and 0 deletions

View File

@@ -72,6 +72,10 @@ define('forum/topic/votes', ['components', 'translator', 'benchpress'], function
if (err) { if (err) {
app.alertError(err.message); app.alertError(err.message);
} }
if (err.message === '[[error:not-logged-in]]') {
ajaxify.go('login');
}
}); });
return false; return false;

View File

@@ -92,6 +92,7 @@ Controllers.login = function (req, res, next) {
var allowLoginWith = (meta.config.allowLoginWith || 'username-email'); var allowLoginWith = (meta.config.allowLoginWith || 'username-email');
var returnTo = (req.headers['x-return-to'] || '').replace(nconf.get('base_url'), ''); var returnTo = (req.headers['x-return-to'] || '').replace(nconf.get('base_url'), '');
console.log('returnTo is', returnTo);
var errorText; var errorText;
if (req.query.error === 'csrf-invalid') { if (req.query.error === 'csrf-invalid') {