refactor(auth): simplify admin session token flow
This commit is contained in:
@@ -3,12 +3,13 @@ package errorsx
|
||||
import "github.com/mlogclub/simple/web"
|
||||
|
||||
const (
|
||||
CodeInvalidParam = 1000
|
||||
CodeBusinessError = 2000
|
||||
CodeAuthUnauthorized = 3000
|
||||
CodeAuthForbidden = 3001
|
||||
CodeAuthInvalidToken = 3002
|
||||
CodeAuthInvalidAccount = 3003
|
||||
CodeInvalidParam = 1000
|
||||
CodeBusinessError = 2000
|
||||
CodeAuthUnauthorized = 3000
|
||||
CodeAuthForbidden = 3001
|
||||
CodeAuthInvalidToken = 3002
|
||||
CodeAuthInvalidAccount = 3003
|
||||
CodeAuthCredentialLocked = 3004
|
||||
)
|
||||
|
||||
func InvalidParam(message string) error {
|
||||
@@ -34,3 +35,7 @@ func InvalidToken(message string) error {
|
||||
func InvalidAccount(message string) error {
|
||||
return web.NewError(CodeAuthInvalidAccount, message)
|
||||
}
|
||||
|
||||
func CredentialLocked(message string) error {
|
||||
return web.NewError(CodeAuthCredentialLocked, message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user