Skip to content

Commit

Permalink
refactor: Use provided context
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Nov 23, 2020
1 parent c4c1e6f commit fee2875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (f *Fosite) AuthenticateClient(ctx context.Context, r *http.Request, form u
return nil, errorsx.WithStack(ErrInvalidClient.WithHint("Claim 'sub' from 'client_assertion' must match the 'client_id' of the OAuth 2.0 Client."))
} else if jti, ok = (*claims)["jti"].(string); !ok || len(jti) == 0 {
return nil, errorsx.WithStack(ErrInvalidClient.WithHint("Claim 'jti' from 'client_assertion' must be set but is not."))
} else if f.Store.ClientAssertionJWTValid(context.Background(), jti) != nil {
} else if f.Store.ClientAssertionJWTValid(ctx, jti) != nil {
return nil, errorsx.WithStack(ErrJTIKnown.WithHint("Claim 'jti' from 'client_assertion' MUST only be used once."))
}

Expand All @@ -181,7 +181,7 @@ func (f *Fosite) AuthenticateClient(ctx context.Context, r *http.Request, form u
if err != nil {
return nil, errorsx.WithStack(err)
}
if err := f.Store.SetClientAssertionJWT(context.Background(), jti, time.Unix(expiry, 0)); err != nil {
if err := f.Store.SetClientAssertionJWT(ctx, jti, time.Unix(expiry, 0)); err != nil {
return nil, err
}

Expand Down

0 comments on commit fee2875

Please sign in to comment.