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

Conflict with Pre-Orders for WooCommerce

Open Shazamepool opened this issue 2 years ago • 0 comments

Describe the bug When the Pre-Orders for WooCommerce plugin is activated, some requests from WooGraphql are no longer able to authenticate users using their authToken.

Queries for which authentication no longer works : - GetCart - GetCustomer

Queries for which authentication still works : - GetViewer

To Reproduce

  1. Woographql and Pre-orders active on your site
  2. Get authToken from login request
  3. Pass the auToken as an authorization header in a getCustomer request.
  4. Check the ID returned by getCustomer if it's "guest" you've reproduced the bug.

Expected behavior When an Authorization header is passed as a header, getCustomer and getCart requests should be able to retrieve the user's information.

Plugin Versions

  • WooGraphQL Version: 0.12.3
  • WPGraphQL Version: 1.14.6
  • WordPress Version: 6.1.3
  • WooCommerce Version: 7.4.1
  • Pre-Orders for WooCommerce Version: 1.2.12

Additional context Login mutation :

mutation($email: String!, $password: String!) {
    login(input: {username: $email, password: $password}) {
        authToken
    }
}

GetCustomer Query :

header -> {Authorization: Bearer $authToken}
query {
  customer {
    id
    username
    databaseId
    sessionToken
  }
}

Shazamepool avatar Jul 12 '23 07:07 Shazamepool