Permalink
Browse files

Constructing callbacks might use the request obj

  • Loading branch information...
1 parent a4b67bb commit 5d58e52a7d26e39b4ecad7a5b6448bc7254265d7 @flashingpumpkin committed Sep 25, 2012
@@ -1 +1 @@
-__version__ = '0.5.7'
+__version__ = '0.5.8'
@@ -143,7 +143,7 @@ def get_access_token(self, verifier=None):
return self._access_token
- def get_redirect_url(self):
+ def get_redirect_url(self, **kwargs):
"""
Return the authorization/authentication URL signed with the request
token.
@@ -221,15 +221,15 @@ def __init__(self, access_token=None):
def client(self):
return httplib2.Http()
- def get_redirect_url(self, state=''):
+ def get_redirect_url(self, state='', **kwargs):
"""
Assemble the URL to where we'll be redirecting the user to to request
permissions.
"""
params = {
'response_type': 'code',
'client_id': self.client_id,
- 'redirect_uri': self.get_callback_url(),
+ 'redirect_uri': self.get_callback_url(**kwargs),
'scope': self.scope or '',
'state': state,
}
@@ -18,7 +18,7 @@ class Facebook(OAuth2):
_user_info = None
- def get_callback_url(self):
+ def get_callback_url(self, **kwargs):
if self.is_https():
return 'https://%s%s' % (Site.objects.get_current().domain,
reverse('socialregistration:facebook:callback'))
@@ -16,7 +16,7 @@ class Foursquare(OAuth2):
_user_info = None
- def get_callback_url(self):
+ def get_callback_url(self, **kwargs):
if self.is_https():
return 'https://%s%s' % (Site.objects.get_current().domain,
reverse('socialregistration:foursquare:callback'))
@@ -16,7 +16,7 @@ class Github(OAuth2):
_user_info = None
- def get_callback_url(self):
+ def get_callback_url(self, **kwargs):
if self.is_https():
return 'https://%s%s' % (Site.objects.get_current().domain,
reverse('socialregistration:github:callback'))
@@ -16,7 +16,7 @@ class Instagram(OAuth2):
_user_info = None
- def get_callback_url(self):
+ def get_callback_url(self, **kwargs):
if self.is_https():
return 'https://%s%s' % (Site.objects.get_current().domain,
reverse('socialregistration:instagram:callback'))
@@ -169,7 +169,7 @@ def post(self, request):
client = self.get_client()()
request.session[self.get_client().get_session_key()] = client
try:
- return HttpResponseRedirect(client.get_redirect_url())
+ return HttpResponseRedirect(client.get_redirect_url(request=request))
except OAuthError, error:
return self.render_to_response({'error': error})

0 comments on commit 5d58e52

Please sign in to comment.