From 59f879bfec2c13555921f6373517b393db3d65b4 Mon Sep 17 00:00:00 2001 From: SagePtr Date: Thu, 2 May 2019 22:06:01 +0200 Subject: [PATCH] Fix double-generation of scratch token (#6832) (#6833) --- models/twofactor.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/models/twofactor.go b/models/twofactor.go index be37c50b469..7f260248bca 100644 --- a/models/twofactor.go +++ b/models/twofactor.go @@ -129,11 +129,7 @@ func aesDecrypt(key, text []byte) ([]byte, error) { // NewTwoFactor creates a new two-factor authentication token. func NewTwoFactor(t *TwoFactor) error { - _, err := t.GenerateScratchToken() - if err != nil { - return err - } - _, err = x.Insert(t) + _, err := x.Insert(t) return err }