Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Auth errors ErrPwdCasingUpper errs.Error = "password must contain at least one uppercase letter, and at least one lowercase letter" ErrPwdCasingLower errs.Error = "password must contain at least one lowercase letter, and at least one uppercase letter" ErrPwdDigits errs.Error = "password must contain at least one digit, and at least one non-digit" ErrPwdSpaces errs.Error = "password must not contain spaces" ErrPwdSpecial errs.Error = "password must contain at least one special character" ErrInvalidLogin errs.Error = "invalid value, please try again" ErrInvalidEmail errs.Error = "invalid email address" ErrInvalidUsername errs.Error = "invalid username" ErrUserExists errs.Error = "user already exists" ErrIsActive errs.Error = "user account is not active" ErrPasswordInvalid errs.Error = "invalid password" ErrPwdHashMismatch errs.Error = "password is not valid" ErrPwdNoMatch errs.Error = "passwords do not match" ErrGenericAuthFail errs.Error = "authentication failed" ErrNoSession errs.Error = "no session found" )
Variables ¶
This section is empty.
Functions ¶
func Fail ¶
Authentication errors can be raised using autherrors.Fail(...)
This makes sure boilerplate code for failing auth is not repeated.
It also allows for a more consistent way to handle auth errors.
We have a hook setup to catch any authentication errors and redirect to the login page (see hooks.go)
func RegisterHook ¶
func RegisterHook()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.