mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
support use 2fa backup code
This commit is contained in:
@@ -190,5 +190,11 @@ func (a *AuthorizationsApi) TwoFactorAuthorizeByRecoveryCodeHandler(c *core.Cont
|
||||
c.SetTokenClaims(claims)
|
||||
|
||||
log.InfofWithRequestId(c, "[authorizations.TwoFactorAuthorizeByRecoveryCodeHandler] user \"uid:%d\" has authorized two factor via recovery code \"%s\", token will be expired at %d", user.Uid, credential.RecoveryCode, claims.ExpiresAt)
|
||||
return token, nil
|
||||
|
||||
authResp := &models.AuthResponse{
|
||||
Token : token,
|
||||
Need2FA: false,
|
||||
}
|
||||
|
||||
return authResp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user