From f4b66212d5eab11834673b729633ca54b488c22b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 11 Nov 2024 16:09:35 +0800 Subject: [PATCH] bugfix --- ahserver/auth_api.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ahserver/auth_api.py b/ahserver/auth_api.py index dfddc47..c30186d 100755 --- a/ahserver/auth_api.py +++ b/ahserver/auth_api.py @@ -31,20 +31,20 @@ async def get_session_userinfo(request): d = await auth.get_auth(request) if d is None: return DictObject() - info = d.split(':') + ui = d.split(':') return DictObject(**{ - 'userid':info[0], - 'username':info[1], - 'userorgid':info[2] + 'userid':ui[0], + 'username':ui[1], + 'userorgid':ui[2] }) async def get_session_user(request): userinfo = await get_session_userinfo(request) - return userinfo.userid + return userinfo.user async def user_login(request, userid, username='', userorgid=''): - info = f'{userid}:{username}:{userorgid}' - await auth.remember(request, info) + ui = f'{userid}:{username}:{userorgid}' + await auth.remember(request, ui) async def user_logout(request): await auth.forget(request) @@ -151,8 +151,8 @@ class AuthAPI: info(f'checkAuth() called ... {request.path=}') t1 = time.time() path = request.path - info = await get_session_userinfo(request) - user = info.userid + userinfo = await get_session_userinfo(request) + user = userinfo.userid is_ok = await self.checkUserPermission(user, path) t2 = time.time() ip = get_client_ip(None, request)