Skip to content

Error in auth begin - Node js #2918

@gutti-yaswanth

Description

@gutti-yaswanth

auth begin throwing me an error called Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

const shopify = shopifyApi({ apiKey: 'swdhfbsjdkfs', apiSecretKey: 'shpss_sajhfcbsdk', scopes: ['write_payment_customizations', 'write_payment_gateways'], hostName: 'https://zig1pjqena.share.zrok.io', apiVersion: ApiVersion.October25 });

app.get('/auth', async (req, res) => { console.log("Inside auth endpoint", req.query); try { await shopify.auth.begin({ shop: shopify.utils.sanitizeShop(req.query.shop, true), callbackPath: '/auth/callback', isOnline: false, rawRequest: req, rawResponse: res, }); }catch (error) { console.error("Error in auth begin:", error); } });

Metadata

Metadata

Assignees

No one assigned

    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