NextJS & Supabase - Wrong redirecting in auth routes

172 views Asked by At

I have my app with nextjs and supabase deployed on render.com. All works as expected in local, but in prod, supabase redirects to http://localhost:10000 after login. Actually all my auth routes after supabase interaction are wrongly redirected.

I saw a PORT variable in render.com which is settled to 10000, but removing it causes no changes, as it is apparently a default variable.

Some more specifics:

  1. sign-in route in nexts: nextJS (auth)/routes/sign-in
  2. The marked console.log above, logs this on my render.com server when on production server logs
  3. Authentications/URL Configuration in Supabase dashboard: supabase url-configs
  4. My middleware.ts file: middleware.ts
  5. the req of the middleware on the server: middleware req
  6. the res of the middleware on the server: middleware res

I very much appreciate any help on this, thanks!

I tried: signing in in production. I expect: to be redirected to https://circulart-statistics.onrender.com/clients. Instead I am redirected to http://localhost:10000/clients. Same happens for any other auth-redirects from supabase.

1

There are 1 answers

0
Carlos del Río Francés On BEST ANSWER

There is apparently some issues at render.com running the version I am using of Next JS (v13.5.4) and node 18.18.2.

It worked perfectly when I tried deploying into vercel.