Skip to content

Commit

Permalink
Use GrantType const string instead of raw string
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Jan 9, 2023
1 parent e60949d commit ad37f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion device_authorize_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (f *Fosite) NewDeviceAuthorizeRequest(ctx context.Context, r *http.Request)
}
request.Client = client

if !client.GetGrantTypes().Has("urn:ietf:params:oauth:grant-type:device_code") {
if !client.GetGrantTypes().Has(string(GrantTypeDeviceCode)) {
return nil, errorsx.WithStack(ErrInvalidGrant.WithHint("The requested OAuth 2.0 Client does not have the 'urn:ietf:params:oauth:grant-type:device_code' grant."))
}
}
Expand Down

0 comments on commit ad37f5d

Please sign in to comment.