Browse Source

Fix double-generation of scratch token (#6832) (#6833)

release/v1.9
SagePtr 4 years ago
committed by Lauris BH
parent
commit
59f879bfec
  1. 6
      models/twofactor.go

6
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
}

Loading…
Cancel
Save