Why does my node app show 'OAuth error invalid_request' after Heroku deployment?

Why does my node app show 'OAuth error invalid_request' after Heroku deployment?

Mohit_garg
Shopify Partner
15 0 1

I deployed my shopify app into heroku (https://cdonconnector-0a2a657316f8.herokuapp.com/) but whenever I accessing it shows No shop provided and when I accessing like this (https://cdonconnector-0a2a657316f8.herokuapp.com/?shop=utkalik-review-store.myshopify.com) It shows me error :-

OAuth error invalid_request: The redirect_uri is not whitelisted

I did added these Url and callback in my partners account :-
https://cdonconnector-0a2a657316f8.herokuapp.com/auth/callback
https://cdonconnector-0a2a657316f8.herokuapp.com/auth/shopify/callback
https://cdonconnector-0a2a657316f8.herokuapp.com/api/auth/callback

My shopify.js looks like this

import { BillingInterval, LATEST_API_VERSION } from "@shopify/shopify-api";
import { shopifyApp } from "@shopify/shopify-app-express";
import { SQLiteSessionStorage } from "@shopify/shopify-app-session-storage-sqlite";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-01";
import { billingConfig } from "./billingConfig.js";
import 'dotenv/config'
 
const DB_PATH = `${process.cwd()}/database.sqlite`;
const shopify = shopifyApp({
api:{
hostName: process.env.SHOPIFY_APP_URL,
apiVersion: LATEST_API_VERSION,
restResources,
billing: billingConfig
},
 
auth: {
path: "/api/auth",
callbackPath: "/api/auth/callback",
},
webhooks: {
path: "/api/webhooks",
},
 
sessionStorage: new SQLiteSessionStorage(DB_PATH),
});



export default shopify;


I added this in my ENV file:-

SHOPIFY_APP_URL="https://cdonconnector-0a2a657316f8.herokuapp.com/" # Ensure it starts with `https://`

Please help someone knows what to do how can I run my apps with this error

Thank you



Reply 1 (1)

1080
Shopify Partner
297 9 64

@Mohit_garg   you have shopify app with embedded app and the app with app bridge configuration.

so you can't hit any Endpoint direct.

you can try to install this app into your dev store then see the the install screen come or not ? 

For me the latest git app for node-shopify app template working fine.