Skip to content

Commit a2984e3

Browse files
committed
separator is hard coded to "?", when in fact it may need to be an & because the redirect_uri may already contain URL parameters
1 parent bb62289 commit a2984e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

oauth2_provider/views/mixins.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,14 @@ def error_response(self, error, **kwargs):
155155
:param error: :attr:`OAuthToolkitError`
156156
"""
157157
oauthlib_error = error.oauthlib_error
158+
159+
separator = '?'
160+
if '?' in oauthlib_error.redirect_uri:
161+
separator = '&'
162+
158163
error_response = {
159164
'error': oauthlib_error,
160-
'url': "{0}?{1}".format(oauthlib_error.redirect_uri, oauthlib_error.urlencoded)
165+
'url': "{0}{1}{2}".format(oauthlib_error.redirect_uri, separator, oauthlib_error.urlencoded)
161166
}
162167
error_response.update(kwargs)
163168

0 commit comments

Comments
 (0)