Skip to content

Commit

Permalink
Relax missing two factor log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Dec 20, 2023
1 parent b6b50bf commit 8d1f085
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/core/controllers/api/users/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 8d1f085

Please sign in to comment.