bugfix
This commit is contained in:
parent
8beb5dbc99
commit
49e8462029
@ -58,11 +58,10 @@ class AuthAPI(AppLogger):
|
|||||||
@web.middleware
|
@web.middleware
|
||||||
async def checkAuth(self,request,handler):
|
async def checkAuth(self,request,handler):
|
||||||
path = request.path
|
path = request.path
|
||||||
if not await self.needAuth(path):
|
|
||||||
return await handler(request)
|
|
||||||
user = await auth.get_auth(request)
|
user = await auth.get_auth(request)
|
||||||
is_ok = await self.checkUserPermission(user, path)
|
is_ok = await self.checkUserPermission(user, path)
|
||||||
if is_ok:
|
if is_ok:
|
||||||
|
print(f'**{user=}, {path} access **')
|
||||||
return await handler(request)
|
return await handler(request)
|
||||||
print(f'**{user=}, {path} forbidden**')
|
print(f'**{user=}, {path} forbidden**')
|
||||||
raise web.HTTPForbidden()
|
raise web.HTTPForbidden()
|
||||||
|
Loading…
Reference in New Issue
Block a user