24 lines
590 B
Go
24 lines
590 B
Go
package auth
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
ErrInvalidCredentials = errors.New("invalid credentials")
|
|
ErrUserExists = errors.New("user already exists")
|
|
ErrUserNotFound = errors.New("user not found")
|
|
ErrPasswordMismatch = errors.New("passwords do not match")
|
|
ErrCredentialsEmpty = errors.New("username and password cannot be empty")
|
|
ErrPasswordTooShort = errors.New("password must be at least 6 characters long")
|
|
)
|
|
|
|
type AccountLockedError struct {
|
|
LockedUntil time.Time
|
|
}
|
|
|
|
func (e AccountLockedError) Error() string {
|
|
return "account temporarily locked"
|
|
}
|