File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,24 @@ def get(self):
62
62
self .get_authenticated_user (self .async_callback (self ._on_auth ))
63
63
return
64
64
self .authenticate_redirect ()
65
-
65
+
66
66
def _on_auth (self , user ):
67
67
if not user :
68
68
raise tornado .web .HTTPError (500 , "Google auth failed" )
69
69
self .set_secure_cookie ("user" , tornado .escape .json_encode (user ))
70
70
self .redirect ("/" )
71
71
72
+
72
73
class LogoutHandler (BaseHandler ):
73
74
def get (self ):
75
+ # This logs the user out of this demo app, but does not log them
76
+ # out of Google. Since Google remembers previous authorizations,
77
+ # returning to this app will log them back in immediately with no
78
+ # interaction (unless they have separately logged out of Google in
79
+ # the meantime).
74
80
self .clear_cookie ("user" )
75
- self .redirect ("/" )
81
+ self .write ('You are now logged out. '
82
+ 'Click <a href="/">here</a> to log back in.' )
76
83
77
84
def main ():
78
85
tornado .options .parse_command_line ()
You can’t perform that action at this time.
0 commit comments