better errormessages at login
This commit is contained in:
parent
87a51c5b6e
commit
c80c942d4a
8
app.js
8
app.js
|
@ -260,7 +260,7 @@ app.post('/login', async (req, res) => {
|
||||||
req.session.activeRiege = 1;
|
req.session.activeRiege = 1;
|
||||||
req.session.activeTab = 'geraete';
|
req.session.activeTab = 'geraete';
|
||||||
req.session.message = [title = '', message = '', type = 'none'];
|
req.session.message = [title = '', message = '', type = 'none'];
|
||||||
log.Info(username + ' ' + password);
|
log.Info('Success: ' + username + ' - ' + password);
|
||||||
if (user.admin_status === 'expired') {
|
if (user.admin_status === 'expired') {
|
||||||
await pool.query('UPDATE users SET role = $1, admin_temp = NULL WHERE id = $2', ['user', user.id]);
|
await pool.query('UPDATE users SET role = $1, admin_temp = NULL WHERE id = $2', ['user', user.id]);
|
||||||
req.session.role = 'user';
|
req.session.role = 'user';
|
||||||
|
@ -272,11 +272,13 @@ app.post('/login', async (req, res) => {
|
||||||
res.redirect('/freischaltung')
|
res.redirect('/freischaltung')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const message = 'Falscher Benutzername oder falsches Passwort';
|
const message = 'Falsches Passwort';
|
||||||
|
log.Info('wrong Pass' +username + ' - ' + password);
|
||||||
res.render('login', { session: req.session, username, message });
|
res.render('login', { session: req.session, username, message });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const message = 'Falscher Benutzername oder falsches Passwort';
|
const message = 'Unbekannter Benutzer';
|
||||||
|
log.Info('wrong User' +username + ' - ' + password)
|
||||||
res.render('login', { session: req.session, username, message });
|
res.render('login', { session: req.session, username, message });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in New Issue