8000 HTTP Auth blocks GraphiQL with bad error message · Issue #3321 · wp-graphql/wp-graphql · GitHub
[go: up one dir, main page]

Skip to content

HTTP Auth blocks GraphiQL with bad error message #3321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
justlevine opened this issue Feb 20, 2025 · 0 comments
Open
2 of 3 tasks

HTTP Auth blocks GraphiQL with bad error message #3321

justlevine opened this issue Feb 20, 2025 · 0 comments
Labels
impact: med Minor performance improvements, fix broad user base issues javascript Pull requests that update Javascript code lang: javascript Pull requests that update JavaScript code type: bug Issue that causes incorrect or unexpected behavior

Comments

@justlevine
Copy link
Collaborator

Description

Two issues at play here:

  1. If HTTP Authentication is enabled for a site, queries made via the WPGraphQL IDE will fail.
  2. When they fail, the IDE fails to catch that its an auth error, and instead tries to return the error as a response.

I'm not sure if we can fix the former, but the latter should be as straightforward to add a try-catch somewhere that lets us check + coerce the response code before returning it blindly.

Steps to reproduce

  1. Enable HTTP Authentication for the WordPress Backend.
  2. Enable GraphQL Debugging
  3. Visit the GraphiQL IDE and open your Browser's Dev Tools > Network tab to monitor any responses.
  4. Run a GraphQL Query

Additional context

  1. The GraphQL Response doesn't catch what's wrong, just that it's retrieving HTML

Image

  1. The response code is there...

Image

  1. So we could have returned a semantic error instead of this:

Image

WPGraphQL Version

2.0.0

WordPress Version

6.7.2

PHP Version

8.2.26

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@jasonbahl jasonbahl added type: bug Issue that causes incorrect or unexpected behavior impact: med Minor performance improvements, fix broad user base issues lang: javascript Pull requests that update JavaScript code javascript Pull requests that update Javascript code labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: med Minor performance improvements, fix broad user base issues javascript Pull requests that update Javascript code lang: javascript Pull requests that update JavaScript code type: bug Issue that causes incorrect or unexpected behavior
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants
0