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

[6.1.0] Cannot complete OAuth process. Could not find an OAuth cookie for shop url #686

Description

@kdeng

Issue summary

I am trying to demonstrate how to retrieve the Shopify store access_token using the following code, and I keep receiving this error. I reviewed another issue (#582), and it mentioned the issue should be fixed. Unfortunately, I still experience this issue.

  shopifyAPI.auth.callback({
      isOnline: false,
      rawResponse: request,
      rawRequest: response
  })

Expected behavior

to have Shopify.auth.callback({ isOnline: true, rawRequest: req, rawResponse: res, }) to not throw an error

  const shopifyAPI = shopifyApi({
    apiKey: apiKey,
    apiSecretKey: apiSecret,
    scopes: getShopifyAppScopes(),
    hostName: getShopifyCallbackHostname(),
    hostScheme: SHOPIFY_APP_HOST_SCHEME,
    apiVersion: SHOPIFY_APP_API_VERSION,
    isEmbeddedApp: true,
  })
  const callbackResponse = await shopifyAPI.auth.callback({
    isOnline: false,
    rawResponse: {},
    rawRequest: {}
  })

Actual behavior

it throw the error :

Error: Cannot complete OAuth process. Could not find an OAuth cookie for shop url: 
    at CookieNotFound.ShopifyError [as constructor] (/Volumes/work/workspaces/my-works/testing/node_modules/@shopify/shopify-api/lib/error.ts:4:3)
    at new CookieNotFound (/Volumes/work/workspaces/my-works/testing/node_modules/@shopify/shopify-api/lib/error.js:174:42)
    at Object.<anonymous> (/Volumes/work/workspaces/my-works/testing/node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.ts:139:13)
    at step (/Volumes/work/workspaces/my-works/testing/node_modules/tslib/tslib.js:144:27)
    at Object.next (/Volumes/work/workspaces/my-works/testing/node_modules/tslib/tslib.js:125:57)
    at fulfilled (/Volumes/work/workspaces/my-works/testing/node_modules/tslib/tslib.js:115:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Could someone help to take a look at this issue? Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions