Fix field name in session cookie; prevented logged in useds authenticating.

This commit is contained in:
Leo Vasanko 2023-10-24 01:47:57 +03:00 committed by Leo Vasanko
parent 4a13f642b2
commit 9428cc2d9c

View File

@ -29,7 +29,7 @@ async def main_stop(app, loop):
async def use_session(req): async def use_session(req):
req.ctx.session = session.get(req) req.ctx.session = session.get(req)
try: try:
req.ctx.user = config.config.users[req.ctx.session["user"]] # type: ignore req.ctx.user = config.config.users[req.ctx.session["username"]] # type: ignore
except (AttributeError, KeyError, TypeError): except (AttributeError, KeyError, TypeError):
req.ctx.user = None req.ctx.user = None
# CSRF protection # CSRF protection