aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSagePtr2019-05-02 23:24:20 +0200
committerLauris BH2019-05-03 00:24:20 +0300
commit74eee64b572bdbe322eca3f4836cd3ec973a5cd2 (patch)
treeb43f253b684ff8fadd752c1e6a1a9d7095db07c2
parentd21dabab4e43412858818039a0f81d48445aef7f (diff)
Fix double-generation of scratch token (backport #6833) (#6835)
-rw-r--r--models/twofactor.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/models/twofactor.go b/models/twofactor.go
index be37c50b4..7f260248b 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
}