mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 15:05:26 +02:00
Added message "password not set" to client
This commit is contained in:
parent
ae18f115f0
commit
202a1ef2dc
2 changed files with 6 additions and 2 deletions
|
@ -17,7 +17,7 @@ app.set('views', path.join(__dirname, 'views'));
|
||||||
app.set('view engine', 'twig');
|
app.set('view engine', 'twig');
|
||||||
require('./utils/twig');
|
require('./utils/twig');
|
||||||
|
|
||||||
app.use(logger('dev '));
|
app.use(logger('dev'));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
|
@ -29,7 +29,11 @@ router.post('/auth', parseForm, csrfProtection, async (req, res) => {
|
||||||
let userDoc = await Users.get();
|
let userDoc = await Users.get();
|
||||||
|
|
||||||
if (!userDoc) {
|
if (!userDoc) {
|
||||||
throw new Error('Password not set');
|
res.render('auth', {
|
||||||
|
title: 'Login page',
|
||||||
|
header: 'Password not set',
|
||||||
|
csrfToken: req.csrfToken()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const passHash = userDoc.passHash;
|
const passHash = userDoc.passHash;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue