Skip to content

Commit

Permalink
added logout to dropbox example
Browse files Browse the repository at this point in the history
  • Loading branch information
gleicon committed Sep 19, 2014
1 parent 82a89aa commit 54cc248
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demos/dropbox_auth/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ def get(self):
yield self.authorize_redirect()


class LogoutHandler(cyclone.web.RequestHandler, DropboxMixin):
def get(self):
self.clear_cookie("oauth_user")
self.clear_cookie("oauth_token")
return "Logged out"


class MainHandler(cyclone.web.RequestHandler):
def get_current_user(self):
return self.get_secure_cookie("oauth_user")
Expand All @@ -39,6 +46,7 @@ class Application(cyclone.web.Application):
def __init__(self):
handlers = [
(r"/auth", AuthHandler),
(r"/logout", LogoutHandler),
(r"/", MainHandler),
]

Expand Down

0 comments on commit 54cc248

Please sign in to comment.