Menu

Login works locally but fails in production (callbacks, emails)
📰

Login works locally but fails in production (callbacks, emails)

DEV Community: authentication·Ahmed·3 days ago
#I0kFoVAp
#devtoauthentication#devto#dev#email#supabase
Reading 0:00
15s threshold

We read 6,996 public posts from builders whose apps broke at or after launch and verified 727 recent cases. 54 of them are the same story: sign-in works for the builder and fails for the first real user. The nearest categories in our split are sign-in & sessions (8% of the 727) and email delivery (3%).

From the builder's side it looks like this. You press "Sign in with GitHub" on the live site and end up on localhost:3000 , or back on the login page. A new user's confirmation email never arrives. Or it arrives and says "Token has expired or is invalid" the first time they click it. Every one of your own tests passes, because each failure depends on who is signing in: your address, your browser, your mail provider.

The full troubleshooting page is here . This article is the reproduction, the tests and the fix, using Supabase and Next.js.

Reproduce it

Start with a fresh Supabase project. In Authentication > URL Configuration the Site URL is http://localhost:3000 and the Redirect URLs list is empty.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.