feat: add StatusAccountLocked user status for TOTP lockouts
This commit is contained in:
parent
ddd9ef5f22
commit
f42a045bdc
|
|
@ -61,6 +61,8 @@ func (s Status) String() string {
|
|||
return "Email Confirmation required"
|
||||
case StatusDisabled:
|
||||
return "Disabled"
|
||||
case StatusAccountLocked:
|
||||
return "Locked"
|
||||
}
|
||||
|
||||
return "Unknown"
|
||||
|
|
@ -70,6 +72,7 @@ const (
|
|||
StatusActive Status = iota
|
||||
StatusEmailConfirmationRequired
|
||||
StatusDisabled
|
||||
StatusAccountLocked
|
||||
)
|
||||
|
||||
// User holds information about an user
|
||||
|
|
@ -153,7 +156,7 @@ func (u *User) ShouldNotify(sessions ...*xorm.Session) (bool, error) {
|
|||
return false, err
|
||||
}
|
||||
|
||||
return user.Status != StatusDisabled, err
|
||||
return user.Status != StatusDisabled && user.Status != StatusAccountLocked, err
|
||||
}
|
||||
|
||||
func (u *User) Lang() string {
|
||||
|
|
|
|||
Loading…
Reference in New Issue