重构错误处理逻辑,使用 fiber.Error 统一返回错误状态码;统一授权枚举值定义到 auth 包
This commit is contained in:
18
web/auth/authorize.go
Normal file
18
web/auth/authorize.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package auth
|
||||
|
||||
type GrantType string
|
||||
|
||||
const (
|
||||
GrantAuthorizationCode = GrantType("authorization_code") // 授权码模式
|
||||
GrantClientCredentials = GrantType("client_credentials") // 客户端凭证模式
|
||||
GrantRefreshToken = GrantType("refresh_token") // 刷新令牌模式
|
||||
GrantPassword = GrantType("password") // 密码模式(私有扩展)
|
||||
)
|
||||
|
||||
type PasswordGrantType string
|
||||
|
||||
const (
|
||||
GrantPasswordSecret = PasswordGrantType("password") // 密码模式
|
||||
GrantPasswordPhone = PasswordGrantType("phone_code") // 手机号模式
|
||||
GrantPasswordEmail = PasswordGrantType("email_code") // 邮箱模式
|
||||
)
|
||||
Reference in New Issue
Block a user