Compare commits
2 commits
47dd0e0971
...
71363b6d11
Author | SHA1 | Date | |
---|---|---|---|
|
71363b6d11 | ||
|
b67c38cacf |
|
@ -33,11 +33,10 @@ router.post('/', (req, res) => {
|
||||||
const match = await global.comparePassword(password, user.passwordHash);
|
const match = await global.comparePassword(password, user.passwordHash);
|
||||||
//console.log(match)
|
//console.log(match)
|
||||||
if (!match) return res.status(401).render('login', { error: 'Invalid username or password.' });
|
if (!match) return res.status(401).render('login', { error: 'Invalid username or password.' });
|
||||||
if (global.checkACL(req, 'login') == false) return res.status(403).render('error', { error: 'You do not have permission to log in.', button: {text:"Go back", action:"back"} });
|
|
||||||
req.session.user = user;;
|
req.session.user = user;;
|
||||||
res.redirect('/dashboard');
|
res.redirect('/dashboard');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
global.log.error(`Database error during login: ${err}`);
|
global.log.error(`Database error during login: ${err.stack}`);
|
||||||
res.status(500).render('login', { error: 'Internal server error.' });
|
res.status(500).render('login', { error: 'Internal server error.' });
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue