Episode 4 of the Bubble to AI code series is now out - authentication in Next.js + Supabase.
It is simple once you understand the basics:
"Log the user in" in Bubble = SignInWithPassword in code. That's it.
Implemented the full authentication flow in 12 minutes:
• Login page with email/password fields
• Authentication workflow (SignInWithPassword)
• Protected dashboard page (server-side redirects)
• Logout button and workflow
Remember those 302 redirects we set up in Bubble?
The "on page load → if current user is logged out → go to login page" workflow?
Exact same pattern in code. Same security. Same redirect. Just written differently.
What really clicked for me: Authentication isn't complicated. It's the same mental model we already use.
Login button → authenticate → redirect to dashboard.
The only difference is typing SignInWithPassword instead of clicking "Log the user in."
Quick question: How many of you have accidentally left a Bubble page unprotected before? (I definitely have 😅)