Skip to content

Commit

Permalink
get backend from the url
Browse files Browse the repository at this point in the history
  • Loading branch information
aitbrahim committed May 6, 2018
1 parent 9777391 commit b21dc76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion oauth2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def psa(redirect_uri=None):
def decorator(func):
@wraps(func)
def wrapper(self, request, *args, **kwargs):
backend = 'facebook'
backend = self.kwargs.get('backend', None)
uri = redirect_uri
if uri and not uri.startswith('/'):
uri = reverse(redirect_uri, args=(backend,))
Expand Down
2 changes: 1 addition & 1 deletion profile/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
views.AuthenticateViewSet.as_view({'post': 'create'}),
name='sign-in'),

url(r'^users/auth', OAuth2View.as_view(),
url(r'^users/auth/(?P<backend>[^/]+)', OAuth2View.as_view(),
name='register_by_access_token'),
]

Expand Down

0 comments on commit b21dc76

Please sign in to comment.