Fix users with disabled totp but not enrolled being unable to login
This commit is contained in:
parent
6a82d4e2af
commit
d718d247c8
1 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,9 @@ func TOTPEnabledForUser(user *User) (bool, error) {
|
|||
if !config.ServiceEnableTotp.GetBool() {
|
||||
return false, nil
|
||||
}
|
||||
return x.Where("user_id = ?", user.ID).Exist(&TOTP{})
|
||||
t := &TOTP{}
|
||||
_, err := x.Where("user_id = ?", user.ID).Get(t)
|
||||
return t.Enabled, err
|
||||
}
|
||||
|
||||
// GetTOTPForUser returns the current state of totp settings for the user.
|
||||
|
|
Loading…
Reference in a new issue