Focuses on API authentication, access scopes, and permission management.
We're having a bit of an odd issue. We have a non-embedded app that's integrating with Shopify through the OAuth flow. This used to work but ever since uninstalling the app from our development store, we are unable to uninstall it again (may be related, but may not be).
What happens is:
We're super confused as to why this is happening. I can't find any logs or errors anywhere. It's especially weird because this used to work, and even going back to a previous version of our website, it still shows the same behaviour.
We are using Next.js, as well as the `@Shopify/shopify-api` NPM package. This is our code for starting the OAuth flow:
import "@shopify/shopify-api/adapters/cf-worker";
import { shopifyApi } from "@shopify/shopify-api";
import { NextResponse } from "next/server";
import { SHOPIFY_APIVERSION } from "@/utils/supabase/constants";
const shopify = shopifyApi({
apiKey: process.env.SHOPIFY_CLIENT_ID,
apiSecretKey: process.env.SHOPIFY_CLIENT_SECRET!,
scopes: ["read_products"],
hostName: process.env.SEAMLESSLY_HOSTNAME!,
hostScheme: "https",
apiVersion: SHOPIFY_APIVERSION,
isEmbeddedApp: false,
});
export default shopify;
export function beginShopifyAuth(
shop: string,
req: Request,
isOnline: boolean
) {
return shopify.auth.begin({
shop,
callbackPath: "/api/shopify/auth/callback",
isOnline,
rawRequest: req,
rawResponse: new NextResponse(),
});
}
Thanks in advance, looking forward to anyone's ideas.