Permalink
Browse files

better handling for twitter auth failure

  • Loading branch information...
1 parent dc13e72 commit a556cc77b833d04f1805bd05a3507253d927e2bc @peterbe committed Sep 20, 2011
Showing with 9 additions and 10 deletions.
  1. +9 −10 handlers.py
View
@@ -227,10 +227,9 @@ def get(self):
def _on_auth(self, user_struct):
if not user_struct:
- url = self.reverse_url('auth_twitter_failed')
- if self.request.query:
- url += '?%s' % self.request.query
- self.redirect(url)
+ options = {}
+ options['page_title'] = "Twitter authentication failed"
+ self.render('twitter_auth_failed.html', **options)
return
username = user_struct.get('username')
self.redis.rpush('usernames', username)
@@ -242,12 +241,12 @@ def _on_auth(self, user_struct):
expires_days=30, path='/')
self.redirect('/')
-@route('/auth/twitter/failed', name='auth_twitter_failed')
-class TwitterAuthFailedHandler(BaseAuthHandler):
- def get(self):
- options = {}
- options['page_title'] = "Twitter authentication failed"
- self.render('twitter_auth_failed.html', **options)
+#@route('/auth/twitter/failed', name='auth_twitter_failed')
+#class TwitterAuthFailedHandler(BaseAuthHandler):
+# def get(self):
+# options = {}
+# options['page_title'] = "Twitter authentication failed"
+# self.render('twitter_auth_failed.html', **options)
@route(r'/auth/logout/', name='logout')
class AuthLogoutHandler(BaseAuthHandler):

0 comments on commit a556cc7

Please sign in to comment.