Browse files

Fixed #28 (google example broken)

  • Loading branch information...
1 parent e2d670a commit 211ae7ffcacbc02a657584c3652acededf555d17 @mitsuhiko committed Oct 6, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 example/google.py
View
6 example/google.py
@@ -42,7 +42,11 @@ def index():
None, headers)
try:
res = urlopen(req)
- except URLError:
+ except URLError, e:
+ if e.code == 401:
+ # Unauthorized - bad token
+ session.pop('access_token', None)
+ return redirect(url_for('login'))
return res.read()
return res.read()

0 comments on commit 211ae7f

Please sign in to comment.