Hi,
I created a Node.js app using the sample-node-app with Shopify CLI. I created an extension on the more actions drop down of the order page, I can get the order IDs, however when I receive the call I would like to run a few Graphql queries based on the orders I get from the extension call. Although I do not receive a session token and I cannot use Shopify.Utils.loadCurrentSession to get the access token.
app.get("/extension/orders/bulk", async (req, res) => {
console.log(req.query);
// Outputs
// {
// ┃ hmac: '111a4...',
// ┃ host: 'dGVz...',
// ┃ ids: ['4381574332601', '4381574070457', '4381573873849'],
// ┃ locale: 'en-CA',
// ┃ session:'2a1f891...',
// ┃ shop: 'tester12auth.myshopify.com',
// ┃ timestamp: '1650849240'
// ┃
// }
res.redirect(`/?shop=${req.query.shop}&host=${req.query.host}`);
const session = await Shopify.Utils.loadCurrentSession(req, res, true);
console.log(session); // Undefined
})
How can I load the current session or get the access token to be able to use the Graphql API?
Thanks