Comments (2)
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
from lighthouse.
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.
from lighthouse.
Related Issues (20)
- Access context in `FieldMiddleware` HOT 3
- CanArgs is defined twice in schema-directives.graphql
- `extend scalar X` directives are lost
- @canFind is missing "model" argument in graphql definition HOT 1
- Allow to customize the unique key for `PaginatedModelsLoader`
- artisan lighthouse:union stub appears to be incorrect HOT 1
- An error occurs in the SubscriptionRegistry when sending a subscription event via Subscription::broadcast with Laravel Octane (Swoole) HOT 5
- Laravel v11 support dependancy missing
- Enum Support for Morph Types HOT 1
- Mutation transaction seem not work HOT 4
- Failed to find class App\GraphQl\Queries\TodoQuery in namespaces [] for directive @paginate
- @whereNull and @whereNotNull No directive found!
- GraphQL subscription with Laravel Reverb HOT 3
- input.id in @can(find: ) HOT 1
- Throttle directive sets wrong decay time HOT 4
- Allow GraphQL types named like PHP reserved keywords in federation entity resolver HOT 1
- When executing Multiple Operations GraphQL, if an error occurs in the StartExecution event listener, an error that ignores the number of operations is returned. HOT 1
- Offer Automatic persisted queries hash in the context HOT 3
- Nested Mutation Regression in v6.37.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lighthouse.