don't ignore error
This commit is contained in:
parent
25ca551ea6
commit
c703bd5442
|
|
@ -305,7 +305,11 @@ func TwoFactorScratchPost(ctx *context.Context, form auth.TwoFactorScratchAuthFo
|
||||||
// Validate the passcode with the stored TOTP secret.
|
// Validate the passcode with the stored TOTP secret.
|
||||||
if twofa.VerifyScratchToken(form.Token) {
|
if twofa.VerifyScratchToken(form.Token) {
|
||||||
// Invalidate the scratch token.
|
// Invalidate the scratch token.
|
||||||
twofa.GenerateScratchToken()
|
_, err = twofa.GenerateScratchToken()
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("UserSignIn", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
if err = models.UpdateTwoFactor(twofa); err != nil {
|
if err = models.UpdateTwoFactor(twofa); err != nil {
|
||||||
ctx.ServerError("UserSignIn", err)
|
ctx.ServerError("UserSignIn", err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user