Build · Authentication · beginner
Add Google Sign-In with OAuth
Authentication SaaS beginner LovableReplit
How to use
- Copy the prompt below
- Paste it into Lovable, Replit
- Review the output and follow up with refinements
Prompt
Add Google OAuth login to this app using Supabase Auth. Show a prominent "Sign in with Google" button on both the landing page and the /login page — use the official Google branding colors and icon. When the user clicks, initiate the OAuth flow via Supabase's signInWithOAuth method with provider set to "google". After successful authentication, redirect the user to /dashboard. On first login, write a new row to the profiles table storing the user's id, full name, email, and avatar URL from the OAuth metadata. If the user cancels the Google sign-in flow mid-way and returns to the app, handle the resulting error gracefully and show them the login page again without an error message. Related prompts
Was this helpful?
Enjoying this guide?
Get weekly practical guides, plus tool updates and implementation playbooks.