Skip to content

Commit d6e19a1

Browse files
james-d-elliottaeneasr
authored andcommitted
refactor: remove unnecessary receiver
1 parent b0a67df commit d6e19a1

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

access_request.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,3 @@ func (a *AccessRequest) GetRefreshTokenGrantedScopes() (scopes Arguments) {
5050
func (a *AccessRequest) SetRefreshTokenGrantedScopes(scopes Arguments) {
5151
a.RefreshTokenGrantedScope = scopes
5252
}
53-
54-
func (a *AccessRequest) SetGrantedScopes(scopes Arguments) {
55-
a.GrantedScope = scopes
56-
}

handler/oauth2/flow_refresh.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,11 @@ func (c *RefreshTokenGrantHandler) PopulateTokenEndpointResponse(ctx context.Con
186186
}
187187

188188
if rtRequest, ok := requester.(fosite.RefreshTokenAccessRequester); ok {
189-
r := requester.Sanitize([]string{}).(*fosite.Request)
190-
r.SetID(ts.GetID())
189+
rtStoreReq := requester.Sanitize([]string{}).(*fosite.Request)
190+
rtStoreReq.SetID(ts.GetID())
191191

192-
rtStoreReq := &fosite.AccessRequest{
193-
Request: *r,
194-
}
195-
196-
rtStoreReq.SetRequestedScopes(rtRequest.GetRefreshTokenRequestedScopes())
197-
rtStoreReq.SetGrantedScopes(rtRequest.GetRefreshTokenGrantedScopes())
192+
rtStoreReq.RequestedScope = rtRequest.GetRefreshTokenRequestedScopes()
193+
rtStoreReq.GrantedScope = rtRequest.GetRefreshTokenGrantedScopes()
198194

199195
if err = c.TokenRevocationStorage.CreateRefreshTokenSession(ctx, refreshSignature, rtStoreReq); err != nil {
200196
return err

oauth2.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,6 @@ type RefreshTokenAccessRequester interface {
260260
// SetRefreshTokenGrantedScopes sets all granted scopes specifically for the refresh token.
261261
SetRefreshTokenGrantedScopes(scopes Arguments)
262262

263-
// SetGrantedScopes sets all granted scopes. This is specifically used in the refresh flow to restore the originally
264-
// granted scopes to the session.
265-
SetGrantedScopes(scopes Arguments)
266-
267263
AccessRequester
268264
}
269265

0 commit comments

Comments
 (0)