Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedLoginType is the error of unsupported login type ErrUnsupportedLoginType = NewBcode(401, 12001, "the login type is not supported") // ErrTokenExpired is the error of token expired ErrTokenExpired = NewBcode(401, 12002, "the token is expired") // ErrTokenNotValidYet is the error of token not valid yet ErrTokenNotValidYet = NewBcode(401, 12003, "the token is not valid yet") // ErrTokenInvalid is the error of token invalid ErrTokenInvalid = NewBcode(401, 12004, "the token is invalid") // ErrTokenMalformed is the error of token malformed ErrTokenMalformed = NewBcode(403, 12005, "the token is malformed") // ErrNotAuthorized is the error of not authorized ErrNotAuthorized = NewBcode(401, 12006, "the user is not authorized") // ErrNotAccessToken is the error of not access token ErrNotAccessToken = NewBcode(401, 12007, "the token is not an access token") // ErrInvalidLoginRequest is the error of invalid login request ErrInvalidLoginRequest = NewBcode(400, 12008, "the login request is invalid") // ErrInvalidDexConfig is the error of invalid dex config ErrInvalidDexConfig = NewBcode(400, 12009, "the dex config is invalid") // ErrRefreshTokenExpired is the error of refresh token expired ErrRefreshTokenExpired = NewBcode(400, 12010, "the refresh token is expired") // ErrNoDexConnector is the error of no dex connector ErrNoDexConnector = NewBcode(400, 12011, "there is no dex connector") )
View Source
var ( // ErrUnsupportedEmailModification is the error of unsupported email modification ErrUnsupportedEmailModification = NewBcode(400, 14001, "the user already has an email address and cannot modify it again") // ErrUserAlreadyDisabled is the error of user already disabled ErrUserAlreadyDisabled = NewBcode(400, 14002, "the user is already disabled") // ErrUserAlreadyEnabled is the error of user already enabled ErrUserAlreadyEnabled = NewBcode(400, 14003, "the user is already enabled") // ErrUserCannotModified is the error of user cannot modified ErrUserCannotModified = NewBcode(400, 14004, "the user cannot be modified in dex login mode") // ErrUserInvalidPassword is the error of user invalid password ErrUserInvalidPassword = NewBcode(400, 14005, "the password is invalid") // ErrDexConfigNotFound means the dex config is not configured ErrDexConfigNotFound = NewBcode(200, 14006, "the dex config is not found") // ErrUserInconsistentPassword is the error of user inconsistent password ErrUserInconsistentPassword = NewBcode(401, 14007, "the password is inconsistent with the user") // ErrUsernameNotExist is the error of username not exist ErrUsernameNotExist = NewBcode(401, 14008, "the username is not exist") // ErrDexNotFound is the error of dex not found ErrDexNotFound = NewBcode(200, 14009, "the dex is not found") // ErrEmptyAdminEmail is the error of empty admin email ErrEmptyAdminEmail = NewBcode(400, 14010, "the admin email is empty, please set the admin email before using sso login") )
View Source
var ErrForbidden = NewBcode(403, 403, "403 Forbidden")
ErrForbidden check user perms failure
View Source
var ErrServer = NewBcode(500, 500, "The service has lapsed.")
ErrServer an unexpected mistake.
ErrUnauthorized check user auth failure
Functions ¶
func ReturnError ¶
func ReturnError(req *restful.Request, res *restful.Response, err error)
Types ¶
Click to show internal directories.
Click to hide internal directories.