diff --git a/oauth2/utils.py b/oauth2/utils.py index 2cb7550..ba802aa 100644 --- a/oauth2/utils.py +++ b/oauth2/utils.py @@ -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,)) diff --git a/profile/urls.py b/profile/urls.py index 89266d8..916c87c 100644 --- a/profile/urls.py +++ b/profile/urls.py @@ -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[^/]+)', OAuth2View.as_view(), name='register_by_access_token'), ]