Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Redirection issue when calling shopify.auth.begin #939

Closed
Taju201 opened this issue Jul 10, 2023 · 2 comments
Closed

Redirection issue when calling shopify.auth.begin #939

Taju201 opened this issue Jul 10, 2023 · 2 comments

Comments

@Taju201
Copy link

Taju201 commented Jul 10, 2023

Issue summary

HTTP 410 Issue when i try to authenticate with shopify like described in the readme file

  • @shopify/shopify-api version: 7.2.0
  • Node version:16.16.0
  • Operating system: Windows 11

Expected behavior

when i call shopify.auth.begin with sanitized shop url, ngrok address etc it should create a redirect url to shopify login screen for user to login

Actual behavior

but it actually returns http 410 error without any error message or any logs in the logger call back, i set logger as Debug and httpRequests as true, still it doesn't provide any logs related to this, so i can't find out what is wrong with it. i initiated shopify instance as described in the readme

Steps to reproduce the problem

  1. initialize shopify instance
const shopify = shopifyApi({
      apiKey: '29c04e5b1b288e04d8cf983480a27a8e',
      apiSecretKey: <Secret Key>,
      scopes: ["read_all_orders","read_customers","write_customers","read_inventory","write_inventory","read_products","write_products"
      ,"read_product_listings","read_publications","write_publications","read_returns","write_returns"],
      hostScheme: 'https',
      hostName: "995b-2405-201-f011-2864-144b-efdf-18e0-953f.ngrok-free.app",
      isEmbeddedApp: false,
      apiVersion:ApiVersion.January23,
      isCustomStoreApp: false,
      logger: {
        log: (severity, message) => {
          console.log("message",message);
        },
        httpRequests:true,
        level:LogSeverity.Debug
      },
      restResources,
    });
call shopify.auth.begin({
       shop: shopify.utils.sanitizeShop("quick-start-ea40ba4a.myshopify.com",true),
       callbackPath: '995b-2405-201-f011-2864-144b-efdf-18e0-953f.ngrok-free.app',
       isOnline: true,
       rawRequest: req,
       rawResponse: res});

it returns http 410 error without any response body or error message

@Taju201 Taju201 changed the title Redirect issue when calling shopify.auth.begin Redirection issue when calling shopify.auth.begin Jul 15, 2023
@paulomarg
Copy link
Contributor

Hey! The only place where we return a 410 response is if we get a request that looks like it was made by a bot - you should see a debug log around that.

It doesn't look like that's your case, but is there a chance your server is changing the incoming request headers (maybe some middleware?) before calling the API? I can see something like that confusing the library we use into thinking this is a bot request.

For context, we use the isbot package for this check.

@github-actions
Copy link
Contributor

We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.

We appreciate your understanding as we try to manage our number of open issues.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants