Commit ce5d0687 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Use the same cookie between api and web interface

parent 10023e81
......@@ -63,7 +63,7 @@ class BaseRequestHandler(RequestHandler):
def get_current_user(self) -> Union[User, None]:
"""Authenticate each request."""
if self.get_secure_cookie('zoe_api_user'):
if self.get_secure_cookie('zoe_web_user'):
uid = self.get_secure_cookie('zoe').decode('uft-8')
log.info('Authentication done using cookie')
return self._uid_to_user(uid)
......
......@@ -29,7 +29,7 @@ class LoginAPI(BaseRequestHandler):
@needs_auth
def get(self):
"""HTTP GET method."""
self.set_secure_cookie('zoe_api_user', self.current_user.username)
self.set_secure_cookie('zoe_web_user', self.current_user.username)
ret = {
'uid': self.current_user.username,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment