mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
Merge pull request #1708 from TriliumNext/fix_http-code-failed-login_#1707
fix(login): send back 401 Unauthorized on failed login attempt
This commit is contained in:
commit
0f06bf43f0
@ -133,7 +133,7 @@ function sendLoginError(req: Request, res: Response, errorType: 'password' | 'to
|
|||||||
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
|
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render('login', {
|
res.status(401).render('login', {
|
||||||
wrongPassword: errorType === 'password',
|
wrongPassword: errorType === 'password',
|
||||||
wrongTotp: errorType === 'totp',
|
wrongTotp: errorType === 'totp',
|
||||||
totpEnabled: totp.isTotpEnabled(),
|
totpEnabled: totp.isTotpEnabled(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user