wp-graphql / wp-graphql-jwt-authentication

Authentication for WPGraphQL using JWT (JSON Web Tokens)
GNU General Public License v3.0
338 stars 74 forks source link

Exposing headers to REST breaks REST #102

Open jasonbahl opened 4 years ago

jasonbahl commented 4 years ago

See: https://github.com/google/web-stories-wp/issues/2950#issuecomment-656714802

The issue is here: https://github.com/wp-graphql/wp-graphql-jwt-authentication/blob/develop/src/ManageTokens.php#L337-L347

Since this isn't filterable, REST API plugins that actually have the need to set headers are being broken by WPGraphQL JWT Auth.

I think the best action is to remove this functionality from this WPGraphQL JWT Auth plugin as I feel like we're over-reaching the responsibility of this plugin anyway.

The intent of this plugin is to handle auth for GraphQL requests. While I'm not opposed to having the JWT tokens work for REST as well, that seems like a responsibility outside the scope of this plugin.

travis-r6s commented 4 years ago

@jasonbahl So this would be linked with #89? I'm having that issue at the moment, where no X-Wp-Total/Pages headers are being exposed...

sangeetjass commented 4 years ago

Is this resolved, in my new stories plugin installation, I am getting the same error..

tsmith-rv commented 4 years ago

I mentioned this in a comment on #89 as well, but I've opened a PR that I believe handles this issue in a way that should prevent so much breakage because of the headers. #118

hatsumatsu commented 3 years ago

Just adding another affected plugin to the list:

https://wordpress.org/plugins/regenerate-thumbnails/

118 fixes it.