1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 00:54:28 +00:00

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

This commit is contained in:
SagePtr 2019-05-02 22:06:01 +02:00 committed by Lauris BH
parent ade88a877d
commit 59f879bfec

View File

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