wp-graphql-jwt-authentication icon indicating copy to clipboard operation
wp-graphql-jwt-authentication copied to clipboard

Exposing headers to REST breaks REST

Open jasonbahl opened this issue 5 years ago • 4 comments

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.

jasonbahl avatar Jul 10 '20 15:07 jasonbahl

@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...

travis-r6s avatar Jul 27 '20 15:07 travis-r6s

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

sangeetjass avatar Sep 29 '20 13:09 sangeetjass

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

tsmith-rv avatar Nov 04 '20 13:11 tsmith-rv

Just adding another affected plugin to the list:

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

#118 fixes it.

hatsumatsu avatar Apr 08 '21 11:04 hatsumatsu