Back

Vercel and NextJS OAuth deployment problem

  • 0
  • Auth
  • Web
  • Cloud
TomasioLT
28 Aug, 2024, 10:13

Hello,

When I developed locally all sign-in options works properly - simple email sign in option, several oauth sign in with providers ( Google, Github, Discord).

But when I deployed it to vercel, when I click to any sign in option ( Email sign -in option works), it always gives me an error. .env local variables made with NEXT prefix, also tried by adding manualy seperate and as a whole .env file Used this tutorial as guidance for Next.js SSR auth: https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-1

TL;DR
Developers facing issues with OAuth sign-in options deployment on Vercel using NextJS. Error received: `AppwriteException: Invalid redirect`. Local development works fine. Tried different configurations for .env variables, followed a Next.js SSR auth tutorial. Solution: Check the redirect URLs and ensure they are correct for OAuth sign-in providers in Vercel settings.
TomasioLT
28 Aug, 2024, 10:27

Also, at Vercel's Runtime Logs got this error:

TypeScript
    at e.redirect (/var/task/.next/server/chunks/545.js:61:10317)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async o.createOAuth2Token (/var/task/.next/server/chunks/545.js:61:32699)
    at async d (/var/task/.next/server/app/sign-up/page.js:1:12389)
    at async /var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:418
    at async rR (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:7978)
    at async r7 (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1144)
    at async es (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:26324)
    at async en.responseCache.get.routeKind (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:1026)
    at async r6.renderToResponseWithComponentsImpl (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:508) {
  code: 400,
  type: '',
  response: '',
  digest: '363716791'
}```
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more