wp-graphql / wp-graphql-jwt-authentication

Authentication for WPGraphQL using JWT (JSON Web Tokens)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

content-type is not allowed by Access-Control-Allow-Headers

bruno-barros opened this issue · comments

I'm working with JWT Authentication on local server without any problem, but deploing the app (on a differente server) I can fetch data from graphql, but NOT able to log in.
I'm getting the CORS message content-type is not allowed by Access-Control-Allow-Headers.
The only difference I could note is that the serve is returning content-type text/html instead of application/json as is expected.
On the server the request works.

graphql([
        'query' => 'mutation MyMutation {
  __typename
  login(input: {clientMutationId: "somelogin", password: "mypassword", username: "somelogin"}) {
    authToken
    clientMutationId
    refreshToken
  }
}
'
    ])

image from the request

Any help?