Compare commits
No commits in common. "71363b6d1122ddc66d5da77a5c3b81c216e63d3a" and "47dd0e097180c6c7e2d25deb664a016aa636b41f" have entirely different histories.
71363b6d11
...
47dd0e0971
|
@ -33,10 +33,11 @@ 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.stack}`);
|
global.log.error(`Database error during login: ${err}`);
|
||||||
res.status(500).render('login', { error: 'Internal server error.' });
|
res.status(500).render('login', { error: 'Internal server error.' });
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue