Back to guide/General Productivity

Auth Flow

Covers every auth page, method, post-auth behavior, and route protection rule. Lovable generates a complete auth system instead of a login page that leads nowhere.

lovable-promptsadditional_auth_methodsdefault_routeprotected_prefix
Edit View
Prompt
Add complete authentication to this app using Supabase Auth:\n\nAuth methods:\n- Email and password (with email confirmation)\n- Google OAuth\n{{additional_auth_methods}}\n\nPages:\n- /login — email/password form + Google button + link to signup\n- /signup — email/password form + Google button + link to login\n- /forgot-password — email input to send reset link\n- /reset-password — new password form (accessed from email link)\n\nPost-auth flow:\n- On signup: create a user profile row with display name from email\n- On login: redirect to {{default_route}}\n- On logout: redirect to /login, clear local state\n\nProtected routes: All routes under {{protected_prefix}} require authentication. Redirect unauthenticated users to /login with a return URL parameter.\n\nUI: Center auth forms, max-width 400px. Show password strength indicator on signup. Display auth errors inline (not alerts). Loading state on submit buttons.

Variables to customize

{{additional_auth_methods}}{{default_route}}{{protected_prefix}}

Why this prompt works

Covers every auth page, method, post-auth behavior, and route protection rule. Lovable generates a complete auth system instead of a login page that leads nowhere.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.