Relax missing two factor log level

This commit is contained in:
Chocobozzz 2023-12-14 08:51:20 +01:00
parent b6b50bf0b4
commit 8d1f0853cc
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 2 deletions

View File

@ -78,10 +78,11 @@ async function handleToken (req: express.Request, res: express.Response, next: e
refresh_token_expires_in: token.refreshTokenExpiresIn
})
} catch (err) {
logger.warn('Login error', { err })
if (err instanceof MissingTwoFactorError) {
res.set(OTP.HEADER_NAME, OTP.HEADER_REQUIRED_VALUE)
logger.debug('Missing two factor error', { err })
} else {
logger.warn('Login error', { err })
}
return res.fail({