more
This commit is contained in:
parent
4f581d156b
commit
d99a72ff82
10
2fa.go
10
2fa.go
|
@ -47,8 +47,14 @@ func Send2FA(u *UserData) error {
|
|||
code := generate2fa()
|
||||
u.Set("2fa", code)
|
||||
u.Set("2faexpires", fmt.Sprintf("%d", time.Now().Add(15*time.Minute).Unix()))
|
||||
firstname, _ := u.Get("firstname")
|
||||
lastname, _ := u.Get("lastname")
|
||||
firstname, ok := u.Get("firstname")
|
||||
if !ok {
|
||||
firstname = ""
|
||||
}
|
||||
lastname, ok := u.Get("lastname")
|
||||
if !ok {
|
||||
lastname = ""
|
||||
}
|
||||
fullname := fmt.Sprintf("%s %s", firstname, lastname)
|
||||
return Send2faEmail(u.Username, fullname, code)
|
||||
|
||||
|
|
Loading…
Reference in New Issue