more
This commit is contained in:
parent
39a1d3d6e0
commit
1885678995
6
2fa.go
6
2fa.go
|
@ -48,10 +48,6 @@ func Send2FA(u *UserData) error {
|
|||
code := generate2fa()
|
||||
u.Set("2fa", code)
|
||||
u.Set("2faexpires", fmt.Sprintf("%d", time.Now().Add(15*time.Minute).Unix()))
|
||||
email, ok := u.Get("email")
|
||||
if !ok {
|
||||
return errors.New("send2fa: no email")
|
||||
}
|
||||
firstname, ok := u.Get("firstname")
|
||||
if !ok {
|
||||
return errors.New("send2fa: no firstname")
|
||||
|
@ -61,6 +57,6 @@ func Send2FA(u *UserData) error {
|
|||
return errors.New("send2fa: no lastname")
|
||||
}
|
||||
fullname := fmt.Sprintf("%s %s", firstname, lastname)
|
||||
return Send2faEmail(email, fullname, code)
|
||||
return Send2faEmail(u.Username, fullname, code)
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue