Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
1 reply
Aman

Callback Url working locally but not working in vercel deployment

Hi guys, I am using NextAuth and providing callback conditionally on the basis of query params, the callback url is working fine in localhost but not in vercel prod,

Here's a gist of my code

  const getUrl = () => {
    if (router.query.source === 'invitation') {
      return `${backendGetCurrentBaseUrl()}/`;
    }
    return `${backendGetCurrentBaseUrl()}/launch`;
  };

backendGetCurrentBaseUrl() functions returns url according to the env prod/dev

Here's a snapshot of the sign in function
Screenshot_2023-01-12_at_4.31.11_PM.png
Was this page helpful?