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"
|
return "Email Confirmation required"
|
||||||
case StatusDisabled:
|
case StatusDisabled:
|
||||||
return "Disabled"
|
return "Disabled"
|
||||||
|
case StatusAccountLocked:
|
||||||
|
return "Locked"
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Unknown"
|
return "Unknown"
|
||||||
|
|
@ -70,6 +72,7 @@ const (
|
||||||
StatusActive Status = iota
|
StatusActive Status = iota
|
||||||
StatusEmailConfirmationRequired
|
StatusEmailConfirmationRequired
|
||||||
StatusDisabled
|
StatusDisabled
|
||||||
|
StatusAccountLocked
|
||||||
)
|
)
|
||||||
|
|
||||||
// User holds information about an user
|
// User holds information about an user
|
||||||
|
|
@ -153,7 +156,7 @@ func (u *User) ShouldNotify(sessions ...*xorm.Session) (bool, error) {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return user.Status != StatusDisabled, err
|
return user.Status != StatusDisabled && user.Status != StatusAccountLocked, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) Lang() string {
|
func (u *User) Lang() string {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue