##// END OF EJS Templates
Renaming user cookie to username to better match usage.
MinRK -
Show More
@@ -43,13 +43,13 b' class AuthenticatedHandler(web.RequestHandler):'
43 43 """A RequestHandler with an authenticated user."""
44 44
45 45 def get_current_user(self):
46 user_id = self.get_secure_cookie("user")
46 user_id = self.get_secure_cookie("username")
47 47 # For now the user_id should not return empty, but it could eventually
48 48 if user_id == '':
49 49 user_id = 'anonymous'
50 50 if user_id is None:
51 51 # prevent extra Invalid cookie sig warnings:
52 self.clear_cookie('user')
52 self.clear_cookie('username')
53 53 if not self.application.password:
54 54 user_id = 'anonymous'
55 55 return user_id
@@ -75,7 +75,7 b' class LoginHandler(AuthenticatedHandler):'
75 75 def post(self):
76 76 pwd = self.get_argument('password', default=u'')
77 77 if self.application.password and pwd == self.application.password:
78 self.set_secure_cookie('user', str(uuid.uuid4()))
78 self.set_secure_cookie('username', str(uuid.uuid4()))
79 79 url = self.get_argument('next', default='/')
80 80 self.redirect(url)
81 81
@@ -208,7 +208,7 b' class AuthenticatedZMQStreamHandler(ZMQStreamHandler):'
208 208 self.on_message = self.on_first_message
209 209
210 210 def get_current_user(self):
211 user_id = self.get_secure_cookie("user")
211 user_id = self.get_secure_cookie("username")
212 212 if user_id == '' or (user_id is None and not self.application.password):
213 213 user_id = 'anonymous'
214 214 return user_id
General Comments 0
You need to be logged in to leave comments. Login now