Authenticationintermediate
Add Authentication With Email and Google
Sign-up, sign-in, sign-out, session handling and protected routes in one pass.
When to use it
User accounts
Lovable Prompt
Add authentication to this project. Include: - An auth page with sign-up and sign-in using email and password, plus Google sign-in. - Sign-out available from the header when signed in. - Session persistence across refreshes. - A protected area that signed-out visitors are redirected away from. - A profile record created automatically for every new user. Important: - The social sign-in redirect must point at a public URL, not directly at a protected page. - Protect the data as well as the pages — signed-out requests must not return private rows. - Handle the "already registered" and "wrong password" cases with readable messages. Acceptance criteria: I can sign up, sign out, sign back in, refresh, and still be signed in.
Why it works
It names the two failure modes that break most generated auth flows, so they get handled up front.
Guides that use this prompt
TutorialAuthentication
How to Add User Roles and Permissions
Admin, editor and member roles done safely — stored separately from user profiles so they cannot be escalated.
advanced 11 minChecked 24 Aug 2026
TutorialAuthentication
How to Create Protected Pages
Restrict routes to signed-in users properly — including the server-side check most AI-generated guards miss.
intermediate 8 minChecked 24 Aug 2026
TutorialAuthentication
How to Add User Login to a Lovable Project
Sign-up, sign-in, sign-out and sessions — plus the settings people forget that break login on the live site.
beginner 10 minChecked 24 Aug 2026