refactored login process to be a form submit instead of ajax-redirect, implemented error message parsing using req.flash

This commit is contained in:
Julian Lam
2014-08-31 22:41:13 -04:00
parent 9ea081deb3
commit 298d904d45
4 changed files with 24 additions and 63 deletions

View File

@@ -125,10 +125,7 @@ Controllers.login = function(req, res, next) {
data.showResetLink = emailersPresent;
data.allowLocalLogin = meta.config.allowLocalLogin === undefined || parseInt(meta.config.allowLocalLogin, 10) === 1;
data.allowRegistration = meta.config.allowRegistration;
if (req.query.next) {
data.previousUrl = req.query.next;
}
data.error = req.flash('error')[0];
res.render('login', data);
};