修改部分枚举字段的编号与注释确保 0 值的正确语义

This commit is contained in:
2025-04-30 17:13:47 +08:00
parent fde5e7226e
commit bdac5d999a
12 changed files with 66 additions and 110 deletions

View File

@@ -188,7 +188,7 @@ func protect(c *fiber.Ctx, grant s.OauthGrantType, clientId, clientSecret string
return nil, s.ErrOauthUnauthorizedClient
}
case s.OauthGrantTypeClientCredentials:
if !client.GrantClient || client.Spec != 0 {
if !client.GrantClient || client.Spec != 3 {
return nil, s.ErrOauthUnauthorizedClient
}
case s.OauthGrantTypeRefreshToken:
@@ -202,7 +202,7 @@ func protect(c *fiber.Ctx, grant s.OauthGrantType, clientId, clientSecret string
}
// 如果客户端是 confidential验证 client_secret失败返回错误
if client.Spec == 0 {
if client.Spec == 3 {
if clientSecret == "" {
return nil, s.ErrOauthInvalidRequest
}