Closed ivanhuk closed 7 months ago
How have you set your guards
config option? I'm assuming from the @middleware
that you don't have that set or it's not set to api
. Try changing it to api
so Ligthouse uses the correct guard.
I would also advise you to use @guard
(instead of @middleware
) to make sure only authenticated users are accessing the field, read more about this here: https://lighthouse-php.com/6/security/authentication.html#configure-the-guard.
How have you set your
guards
config option? I'm assuming from the@middleware
that you don't have that set or it's not set toapi
. Try changing it toapi
so Ligthouse uses the correct guard.I would also advise you to use
@guard
(instead of@middleware
) to make sure only authenticated users are accessing the field, read more about this here: https://lighthouse-php.com/6/security/authentication.html#configure-the-guard.
I solved the problem. this is due to the fact that I used multytenancy, and the system searched for an authorization token in the central database, but it should have searched in the tenant database, because of this, I could not understand why the user was not authorized when sending the token
I have a problem with laravel passport:
$subscriber->context->user always returns null
here front-end part
here result of requests: