refactor(auth): simplify admin session token flow

This commit is contained in:
mlogclub
2026-04-30 17:42:24 +08:00
parent e763a75f78
commit fbafb13a8a
12 changed files with 411 additions and 179 deletions
+11 -6
View File
@@ -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)
}