Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 0f06bf4

Browse files
authored
Merge pull request #1708 from TriliumNext/fix_http-code-failed-login_#1707
fix(login): send back 401 Unauthorized on failed login attempt
2 parents 171a023 + fa350e1 commit 0f06bf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function sendLoginError(req: Request, res: Response, errorType: 'password' | 'to
133133
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
134134
}
135135

136-
res.render('login', {
136+
res.status(401).render('login', {
137137
wrongPassword: errorType === 'password',
138138
wrongTotp: errorType === 'totp',
139139
totpEnabled: totp.isTotpEnabled(),

0 commit comments

Comments
 (0)