some more fixes

This commit is contained in:
2022-11-24 18:41:57 +03:00
parent b2b8cf747f
commit 59640df3bc
2 changed files with 14 additions and 11 deletions

View File

@@ -58,6 +58,7 @@ def login_required(func):
async def wrap(parent, info: GraphQLResolveInfo, *args, **kwargs):
# print('[auth.authenticate] login required for %r with info %r' % (func, info)) # debug only
auth: AuthCredentials = info.context["request"].auth
print('[auth.authenticate] request auth data: %r' % auth) # debug only
if not auth.logged_in:
return {"error": auth.error_message or "Please login"}
return await func(parent, info, *args, **kwargs)