Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix get_access_token, multiple tokens created at once #111

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions provider/oauth2/backends.py
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ def authenticate(self, request=None):
if request is None:
return None

form = ClientAuthForm(request.REQUEST)
form = ClientAuthForm(request.POST)

if form.is_valid():
return form.cleaned_data.get('client')
@@ -74,7 +74,7 @@ def authenticate(self, request=None):
if request is None:
return None

form = PublicPasswordGrantForm(request.REQUEST)
form = PublicPasswordGrantForm(request.POST)

if form.is_valid():
return form.cleaned_data.get('client')
6 changes: 3 additions & 3 deletions provider/views.py
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ def error_response(self, error, mimetype='application/json', status=400,
Return an error response to the client with default status code of
*400* stating the error as outlined in :rfc:`5.2`.
"""
return HttpResponse(json.dumps(error), mimetype=mimetype,
return HttpResponse(json.dumps(error), content_type=mimetype,
status=status, **kwargs)

def get(self, request):
@@ -463,7 +463,7 @@ def error_response(self, error, mimetype='application/json', status=400,
Return an error response to the client with default status code of
*400* stating the error as outlined in :rfc:`5.2`.
"""
return HttpResponse(json.dumps(error), mimetype=mimetype,
return HttpResponse(json.dumps(error), content_type=mimetype,
status=status, **kwargs)

def access_token_response(self, access_token):
@@ -488,7 +488,7 @@ def access_token_response(self, access_token):
pass

return HttpResponse(
json.dumps(response_data), mimetype='application/json'
json.dumps(response_data), content_type='application/json'
)

def authorization_code(self, request, data, client):