Fix field name in session cookie; prevented logged in useds authenticating.
This commit is contained in:
parent
4a13f642b2
commit
9428cc2d9c
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user