support use 2fa backup code

This commit is contained in:
MaysWind
2020-10-22 01:30:25 +08:00
parent 669fe842cb
commit 32119f6fe1
6 changed files with 76 additions and 14 deletions
+7 -1
View File
@@ -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
}