jamesedmonston / graphql-authentication

GraphQL authentication for your headless Craft CMS applications.
Other
28 stars 22 forks source link

GraphQL Authentication choosing wrong schema when applying field rules #119

Closed danieltott closed 1 year ago

danieltott commented 1 year ago

Problem:

When querying the graphQL endpoint not as a logged-in user via GraphQL Authentication, but just using a Craft GraphQL schema token (via Authorization: Bearer ....), GraphQL Authentication is still applying the field rules but applying rules from the wrong Schema (seems to be always using Public).

I would expect GraphQL Authentication to either ignore requests that aren't coming through the JWT auth, or choose the correct Schema.

Craft Version
Craft Pro 4.3.6.1 (latest at this time)
GraphQL Authentication version
2.3.0 (latest at this time)

image

To reproduce:

I've created a reproduction repo with instructions on how to recreate this bug - it's pretty straight forward.

To recreate on your own setup:

You'll get an error response like this:

{
  "errors": [
    {
      "message": "User doesn't have permission to access requested field(s)"
    }
  ]
}
jamesedmonston commented 1 year ago

@danieltott sounds like this is related to the changes made here.

Thanks for your detailed issue and repro! I'll get it sorted.

Thanks!

jamesedmonston commented 1 year ago

@danieltott fixed in 2.3.1!