mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Cracking the OAuth bug with print statements.
This commit is contained in:
parent
371f456b3d
commit
841abe22db
1 changed files with 4 additions and 0 deletions
|
@ -90,15 +90,19 @@ def reader_callback(request):
|
|||
|
||||
if request.user.is_authenticated():
|
||||
user_token = OAuthToken.objects.get(user=request.user)
|
||||
print "Authenticated user_token: %s" % user_token
|
||||
else:
|
||||
try:
|
||||
user_token = OAuthToken.objects.get(session_id=request.session.session_key)
|
||||
print "Found session user_token: %s" % user_token
|
||||
except OAuthToken.DoesNotExist:
|
||||
user_tokens = OAuthToken.objects.filter(remote_ip=request.META['REMOTE_ADDR']).order_by('-created_date')
|
||||
print "Found ip user_tokens: %s" % user_tokens
|
||||
if user_tokens:
|
||||
user_token = user_tokens[0]
|
||||
user_token.session_id = request.session.session_key
|
||||
user_token.save()
|
||||
print "Found ip token in user_tokens: %s" % user_token
|
||||
|
||||
# Authenticated in Google, so verify and fetch access tokens
|
||||
token = oauth.Token(user_token.request_token, user_token.request_token_secret)
|
||||
|
|
Loading…
Add table
Reference in a new issue