wp-graphql-polylang icon indicating copy to clipboard operation
wp-graphql-polylang copied to clipboard

Cannot query viewer when logged in other source than the cms

Open philip-akerfeldt opened this issue 4 years ago • 0 comments

Hi! I have an encountered an issue when I was trying to fetch the currently logged in user through the viewer query. I have Polylang v2.8.4, WP GraphQL Polylang v0.5.0 enabled. My authentication plugin is WPGraphQL JWT Authentication v0.4.1.

Steps to reproduce:

  1. Log in through mutation query. Get back jwt token. No issue here at all.
  2. Pass jwt token as Bearer in authentication header for the viewer query. The query looks like this:
query getViewerCollections {
    viewer {
         name
         email
     }
}

The server response is 403 forbidden and:

{
    "data": {
        "viewer": null
    }
}

When I disable the WP GraphQL Polylang plugin then everything works as intended.

Any ideas on why this might happen?

philip-akerfeldt avatar Nov 20 '20 18:11 philip-akerfeldt