Skip to content

Commit

Permalink
fix: redirect URI should be the last parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Feb 6, 2024
1 parent f9a07c6 commit 68fddcc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oauthlib/oauth2/rfc6749/parameters.py
Expand Up @@ -73,8 +73,6 @@ def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None,
params = [(('response_type', response_type)),
(('client_id', client_id))]

if redirect_uri:
params.append(('redirect_uri', redirect_uri))
if scope:
params.append(('scope', list_to_scope(scope)))
if state:
Expand All @@ -87,6 +85,9 @@ def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None,
if kwargs[k]:
params.append((str(k), kwargs[k]))

if redirect_uri:
params.append(('redirect_uri', redirect_uri))

return add_params_to_uri(uri, params)


Expand Down

0 comments on commit 68fddcc

Please sign in to comment.