fix-no-auth

This commit is contained in:
tonyrewin 2022-11-28 17:15:54 +03:00
parent a76bb2aeb6
commit d8c293a56e

View File

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