Show More
@@ -37,7 +37,13 b' class LoginHandler(IPythonHandler):' | |||
|
37 | 37 | typed_password = self.get_argument('password', default=u'') |
|
38 | 38 | if self.login_available(self.settings): |
|
39 | 39 | if passwd_check(self.hashed_password, typed_password): |
|
40 | self.set_secure_cookie(self.cookie_name, str(uuid.uuid4())) | |
|
40 | # tornado <4.2 have a bug that consider secure==True as soon as | |
|
41 | # 'secure' kwarg is passed to set_secure_cookie | |
|
42 | if self.settings.get('secure_cookie', self.request.protocol == 'https'): | |
|
43 | kwargs = {'secure':True} | |
|
44 | else: | |
|
45 | kwargs = {} | |
|
46 | self.set_secure_cookie(self.cookie_name, str(uuid.uuid4()), **kwargs) | |
|
41 | 47 | else: |
|
42 | 48 | self._render(message={'error': 'Invalid password'}) |
|
43 | 49 | return |
General Comments 0
You need to be logged in to leave comments.
Login now