31 lines
1.3 KiB
Go
31 lines
1.3 KiB
Go
|
|
package domain
|
|||
|
|
|
|||
|
|
import "errors"
|
|||
|
|
|
|||
|
|
// 密碼政策文案(與 FE password.policy.hint / api.err.400003 一致)
|
|||
|
|
const (
|
|||
|
|
PasswordMinLen = 12
|
|||
|
|
PasswordPolicyEN = "Password must be at least 12 characters with upper, lower, digit, and symbol"
|
|||
|
|
PasswordPolicyZH = "密碼須至少 12 碼,且含大寫、小寫、數字與符號"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
var (
|
|||
|
|
ErrNotFound = errors.New("member not found")
|
|||
|
|
ErrEmailNotRegistered = errors.New("email not registered")
|
|||
|
|
ErrEmailTaken = errors.New("email already exists")
|
|||
|
|
ErrPhoneTaken = errors.New("phone already exists")
|
|||
|
|
ErrIdentityTaken = errors.New("login identity already bound")
|
|||
|
|
ErrIdentityNotFound = errors.New("login identity not found")
|
|||
|
|
ErrBadPassword = errors.New("invalid credentials")
|
|||
|
|
ErrSuspended = errors.New("account suspended")
|
|||
|
|
ErrUnverified = errors.New("account not verified")
|
|||
|
|
ErrLastAdmin = errors.New("cannot demote or suspend the last active admin")
|
|||
|
|
ErrSelfSuspend = errors.New("cannot suspend yourself")
|
|||
|
|
// ErrWeakPassword — API 400003;Message = PasswordPolicyEN
|
|||
|
|
ErrWeakPassword = errors.New(PasswordPolicyEN)
|
|||
|
|
ErrInvalidCode = errors.New("invalid or expired code")
|
|||
|
|
ErrAlreadyBound = errors.New("already bound")
|
|||
|
|
ErrInvalidPlatform = errors.New("invalid platform")
|
|||
|
|
ErrOAuthFailed = errors.New("oauth verification failed")
|
|||
|
|
)
|