Show More
@@ -18,6 +18,7 b' Authors:' | |||||
18 |
|
18 | |||
19 | import logging |
|
19 | import logging | |
20 | import Cookie |
|
20 | import Cookie | |
|
21 | import uuid | |||
21 |
|
22 | |||
22 | from tornado import web |
|
23 | from tornado import web | |
23 | from tornado import websocket |
|
24 | from tornado import websocket | |
@@ -68,7 +69,7 b' class LoginHandler(AuthenticatedHandler):' | |||||
68 | def post(self): |
|
69 | def post(self): | |
69 | pwd = self.get_argument("password", default=u'') |
|
70 | pwd = self.get_argument("password", default=u'') | |
70 | if self.application.password and pwd == self.application.password: |
|
71 | if self.application.password and pwd == self.application.password: | |
71 |
self.set_secure_cookie("user", s |
|
72 | self.set_secure_cookie("user", str(uuid.uuid4())) | |
72 | url = self.get_argument("next", default="/") |
|
73 | url = self.get_argument("next", default="/") | |
73 | self.redirect(url) |
|
74 | self.redirect(url) | |
74 |
|
75 |
@@ -41,7 +41,6 b' function add_next_to_action(){' | |||||
41 |
|
41 | |||
42 | <div id="content_panel"> |
|
42 | <div id="content_panel"> | |
43 | <form action="/login" method="post"> |
|
43 | <form action="/login" method="post"> | |
44 | Name: <input type="text" name="name" value="{{user_id}}"> |
|
|||
45 | Password: <input type="password" name="password"> |
|
44 | Password: <input type="password" name="password"> | |
46 | <input type="submit" value="Sign in"> |
|
45 | <input type="submit" value="Sign in"> | |
47 | </form> |
|
46 | </form> |
General Comments 0
You need to be logged in to leave comments.
Login now