This commit is contained in:
yumoqing 2023-06-12 13:41:33 +08:00
parent d3a95abfe4
commit 7ab886347b
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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)