Skip to content

Commit

Permalink
Merge 0cb372f into 88b4530
Browse files Browse the repository at this point in the history
  • Loading branch information
st4lk committed Apr 18, 2020
2 parents 88b4530 + 0cb372f commit 53dd268
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -244,7 +244,7 @@ Quick start
This redirect_uri must be equal in front-end request and in back-end request.
Back-end will not do any redirect in fact.

It is also possible to specify provider in url, not in request body.
It is also possible to specify provider in URL, not in request body.
Just append it to the url:

POST /api/login/social/session/facebook/
Expand All @@ -255,6 +255,9 @@ Quick start
"code": "AQBPBBTjbdnehj51"
}

Provider defined in URL has higher priority than provider in body.
If both are specified - provider will be taken from URL.


OAuth 2.0 workflow with rest-social-auth
-----------------------------------------
Expand Down
7 changes: 3 additions & 4 deletions rest_social_auth/views.py
Expand Up @@ -213,10 +213,9 @@ def get_redirect_uri(self, manual_redirect_uri):
return manual_redirect_uri

def get_provider_name(self, input_data):
if 'provider' in input_data:
return input_data['provider']
else:
return self.kwargs.get('provider')
if self.kwargs.get('provider'):
return self.kwargs['provider']
return input_data.get('provider')

def respond_error(self, error):
if isinstance(error, Exception):
Expand Down

0 comments on commit 53dd268

Please sign in to comment.