st4lk / django-rest-social-auth

OAuth signin with django rest framework
MIT License
521 stars 122 forks source link

Give priority to kwarg for getting provider name rather than input data in get_provider_name #121

Closed jd-solanki closed 4 years ago

jd-solanki commented 4 years ago

Hi, I am using VueJS as frontned with vue-authenticate package.

This package works fine. However, when it makes request to backed for google it sends provider as 'google' as we spell it in simple term and not 'google-oauth'

Due to this difference I am getting error while getting access_token for google. So, I checked the README and found that I can actually make request to full URL defining provider like below:

/login/social/token/google-oauth2

However, When a request is made that package sends provider in dict as normal to above defined URL specific which provider I am sending request to. Still It gives 404.

Later I checked source code and found below code: Function: get_provider_name

This function first check for provider in input_data and then later in URL.

So, I would like to change this order in reverse order and first check for provider in URL and then check it in input_data

I can PR if you like.

Regards

st4lk commented 4 years ago

Hello, @jd-0001 !

Yes, makes sense to me: https://github.com/st4lk/django-rest-social-auth/pull/123

st4lk commented 4 years ago

Available in pypi now: v4.2.0