From 846f2feb6dc52151464348fc7c2d8ac48d2c0caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=96=AF=E6=9D=B0?= Date: Mon, 8 Sep 2025 18:35:32 +0800 Subject: [PATCH] fix: change error type from ErrUnauthorizedClient to ErrUnsupportedGrantType Update GetAccessToken function to return more appropriate error type for unsupported grant type scenarios. --- server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index f4dba2d..d5e1d3d 100755 --- a/server/server.go +++ b/server/server.go @@ -393,7 +393,7 @@ func (s *Server) CheckGrantType(gt oauth2.GrantType) bool { func (s *Server) GetAccessToken(ctx context.Context, gt oauth2.GrantType, tgr *oauth2.TokenGenerateRequest) (oauth2.TokenInfo, error) { if allowed := s.CheckGrantType(gt); !allowed { - return nil, errors.ErrUnauthorizedClient + return nil, errors.ErrUnsupportedGrantType } if fn := s.ClientAuthorizedHandler; fn != nil {