Skip to content

Commit

Permalink
Merge pull request #14 from ash211/master
Browse files Browse the repository at this point in the history
Catch GraphAPI exception with stale credentials
  • Loading branch information
ash211 committed Jan 10, 2012
2 parents b46a21f + 7a5ab61 commit 346e6de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ def get_user_from_cookie(cookies, app_id, app_secret):
cookie = cookies.get("fbsr_" + app_id, "")
if not cookie: return None
parsed_request = parse_signed_request(cookie, app_secret)
result = get_access_token_from_code(parsed_request["code"], "",
app_id, app_secret)
try:
result = get_access_token_from_code(parsed_request["code"], "",
app_id, app_secret)
except GraphAPIError:
return None
result["uid"] = parsed_request["user_id"]
return result

Expand Down

0 comments on commit 346e6de

Please sign in to comment.