Closed kashy96 closed 8 months ago
You should instruct lighthouse to use the Sanctum guard, like so:
// File: ./config/lighthouse.php
/*
|--------------------------------------------------------------------------
| Authentication Guard
|--------------------------------------------------------------------------
|
| The guard to use for authenticating GraphQL requests, if needed.
| This setting is used whenever Lighthouse looks for an authenticated user, for example in directives
| such as `@guard` and when applying the `AttemptAuthentication` middleware.
|
*/
'guard' => 'sanctum',
I have recently upgraded my laravel application to 10, I am using daniel-de-wit/lighthouse-sanctum package for authentication with laravel sanctum. My login mutation works and returns the token, but for queries or mutations which need authentication I am getting unauthenticated error although authenticated. The guards inside lighthouse is null i-e 'guards' => null