Skip to content
Every tutorial here is 100% free — and always will be
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

Website made, maintained and hosted by PromptSites.com

PromptSites logo