From 7ab886347b08801051add4933822d24d486f379c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 12 Jun 2023 13:41:33 +0800 Subject: [PATCH] bugfix --- ahserver/auth_api.py | 3 ++- ahserver/processorResource.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ahserver/auth_api.py b/ahserver/auth_api.py index 38aa1d1..1083d84 100755 --- a/ahserver/auth_api.py +++ b/ahserver/auth_api.py @@ -34,7 +34,8 @@ class AuthAPI(AppLogger): # Create an auth ticket mechanism that expires after 1 minute (60 # seconds), and has a randomly generated secret. Also includes the # optional inclusion of the users IP address in the hash - policy = auth.SessionTktAuthentication(urandom(32), 3600, + policy = auth.SessionTktAuthentication(urandom(32), 120, + reissue_time=100, include_ip=True) # setup aiohttp_auth.auth middleware in aiohttp fashion diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 8c5c47b..8eaa1e8 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -208,6 +208,12 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): async def remember_user(userid): await auth.remember(request, userid) + + async def remember_ticket(ticket): + await auth.remember_ticket(request, ticket) + + async def get_ticket(): + return await auth.get_ticket(request) async def forget_user(): await auth.forget(request)