bugfix
This commit is contained in:
parent
e438dc132a
commit
3452427c52
@ -57,11 +57,11 @@ class AuthAPI(AppLogger):
|
|||||||
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**')
|
|
||||||
if user is None:
|
if user is None:
|
||||||
|
print(f'**{user=}, {path} need login**')
|
||||||
raise web.HTTPUnauthorized
|
raise web.HTTPUnauthorized
|
||||||
|
print(f'**{user=}, {path} forbidden**')
|
||||||
raise web.HTTPForbidden()
|
raise web.HTTPForbidden()
|
||||||
|
|
||||||
async def checkUserPermission(self, user, path):
|
async def checkUserPermission(self, user, path):
|
||||||
|
Loading…
Reference in New Issue
Block a user