Skip to content

Commit

Permalink
Added settings for changing Facebook auth url (#1480)
Browse files Browse the repository at this point in the history
* Configuration option added to change Facebook OAUTH authorize url

* Fixed: import app_settings
  • Loading branch information
yeonsh authored and pennersr committed Sep 12, 2016
1 parent 4e79032 commit 5e1d66b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion allauth/socialaccount/providers/facebook/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from allauth.socialaccount.helpers import complete_social_login
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount import providers
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
Expand Down Expand Up @@ -49,8 +50,11 @@ def fb_complete_login(request, app, token):

class FacebookOAuth2Adapter(OAuth2Adapter):
provider_id = FacebookProvider.id
provider_default_auth_url = 'https://www.facebook.com/dialog/oauth'

authorize_url = 'https://www.facebook.com/dialog/oauth'
settings = app_settings.PROVIDERS.get(provider_id, {})

authorize_url = settings.get('AUTHORIZE_URL', provider_default_auth_url)
access_token_url = GRAPH_API_URL + '/oauth/access_token'
expires_in_key = 'expires'

Expand Down

0 comments on commit 5e1d66b

Please sign in to comment.