lock accounts after enough failed login attempts
This commit is contained in:
parent
5cc9a1ca76
commit
1c0e541c89
7 changed files with 153 additions and 13 deletions
|
@ -6,15 +6,18 @@ import (
|
|||
)
|
||||
|
||||
const COOKIE_TOKEN string = "AM_SESSION"
|
||||
const MAX_LOGIN_FAIL_ATTEMPTS int = 3
|
||||
|
||||
type (
|
||||
Account struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
Username string `json:"username" db:"username"`
|
||||
Password string `json:"password" db:"password"`
|
||||
Email sql.NullString `json:"email" db:"email"`
|
||||
AvatarURL sql.NullString `json:"avatar_url" db:"avatar_url"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
Account struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
Username string `json:"username" db:"username"`
|
||||
Password string `json:"password" db:"password"`
|
||||
Email sql.NullString `json:"email" db:"email"`
|
||||
AvatarURL sql.NullString `json:"avatar_url" db:"avatar_url"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
FailAttempts int `json:"fail_attempts" db:"fail_attempts"`
|
||||
Locked bool `json:"locked" db:"locked"`
|
||||
|
||||
Privileges []AccountPrivilege `json:"privileges"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue