Manage session properly.
This commit is contained in:
parent
237daf771d
commit
c0e0b0da82
|
@ -165,7 +165,8 @@ async def logout_handler(request: web.Request) -> web.Response:
|
|||
async def checkin_handler(request: web.Request) -> web.Response:
|
||||
alog.debug("checkin")
|
||||
session = await get_session(request)
|
||||
op = OPERATORS.get(session.get("async_operator"))
|
||||
user_session = USERS.get(session["async_operator"], UserSession("NOONE"))
|
||||
op = OPERATORS.get(user_session)
|
||||
if not op:
|
||||
return web.json_response(
|
||||
{"error": "No session", "logged_in": False}, status=401
|
||||
|
@ -179,7 +180,8 @@ async def checkin_handler(request: web.Request) -> web.Response:
|
|||
async def checkout_handler(request: web.Request) -> web.Response:
|
||||
alog.debug("checkout")
|
||||
session = await get_session(request)
|
||||
op = OPERATORS.get(session.get("async_operator"))
|
||||
user_session = USERS.get(session["async_operator"], UserSession("NOONE"))
|
||||
op = OPERATORS.get(user_session)
|
||||
if not op:
|
||||
return web.json_response(
|
||||
{"error": "No session", "logged_in": False}, status=401
|
||||
|
|
Loading…
Reference in New Issue
Block a user