@@ -223,15 +223,6 @@ func (s *Server) GetAuthorizeToken(ctx context.Context, req *AuthorizeRequest) (
223223
224224// check the client allows the authorized scope
225225if fn := s .ClientScopeHandler ; fn != nil {
226- tgr := & oauth2.TokenGenerateRequest {
227- ClientID : req .ClientID ,
228- UserID : req .UserID ,
229- RedirectURI : req .RedirectURI ,
230- Scope : req .Scope ,
231- AccessTokenExp : req .AccessTokenExp ,
232- Request : req .Request ,
233- }
234-
235226allowed , err := fn (tgr )
236227if err != nil {
237228return nil , err
@@ -240,16 +231,8 @@ func (s *Server) GetAuthorizeToken(ctx context.Context, req *AuthorizeRequest) (
240231}
241232}
242233
243- tgr = & oauth2.TokenGenerateRequest {
244- ClientID : req .ClientID ,
245- UserID : req .UserID ,
246- RedirectURI : req .RedirectURI ,
247- Scope : req .Scope ,
248- AccessTokenExp : req .AccessTokenExp ,
249- Request : req .Request ,
250- CodeChallenge : req .CodeChallenge ,
251- CodeChallengeMethod : req .CodeChallengeMethod ,
252- }
234+ tgr .CodeChallenge = req .CodeChallenge
235+ tgr .CodeChallengeMethod = req .CodeChallengeMethod
253236
254237return s .Manager .GenerateAuthToken (ctx , req .ResponseType , tgr )
255238}
@@ -390,7 +373,8 @@ func (s *Server) CheckGrantType(gt oauth2.GrantType) bool {
390373}
391374
392375// GetAccessToken access token
393- func (s * Server ) GetAccessToken (ctx context.Context , gt oauth2.GrantType , tgr * oauth2.TokenGenerateRequest ) (oauth2.TokenInfo , error ) {
376+ func (s * Server ) GetAccessToken (ctx context.Context , gt oauth2.GrantType , tgr * oauth2.TokenGenerateRequest ) (oauth2.TokenInfo ,
377+ error ) {
394378if allowed := s .CheckGrantType (gt ); ! allowed {
395379return nil , errors .ErrUnauthorizedClient
396380}
0 commit comments