How do I add Google login?
Last checked 31 Aug 2026
Short answer
Ask Lovable to add Google sign-in — it can use Lovable's managed Google OAuth for a quick setup, or your own Google Cloud OAuth credentials if you need custom branding or scopes.
Two ways to set it up
Lovable supports adding Google authentication in two modes:
- Lovable-managed Google OAuth — quicker, uses shared OAuth credentials Lovable manages, good for getting Google sign-in working fast.
- Your own Google Cloud OAuth credentials — needed if you want your own consent screen branding, custom scopes, or you're publishing an app that needs Google's own verification.
Requesting it
Add Google sign-in to my login page using Lovable's managed Google OAuth
or, if you already have Google Cloud credentials:
Add Google sign-in using our own Google OAuth client ID and secret — I'll paste them in as secrets
Setting up your own credentials (if needed)
- Create an OAuth client in Google Cloud Console.
- Set the authorised redirect URI to the one Lovable/Supabase auth provides for your project.
- Give Lovable the client ID and secret to store as secrets — never paste them into front-end code.
What usually goes wrong
- Redirect URI mismatch — Google rejects the sign-in if the URI configured in Google Cloud Console doesn't exactly match the one your backend uses. Double-check trailing slashes and http vs https.
- Testing on a preview URL that isn't in the authorised list, causing sign-in to fail only in preview, not production, or vice versa.
- Assuming Google login alone secures your data — it only confirms identity; you still need RLS policies for what a logged-in Google user can access.
- Publishing with the managed option when Google's verification process requires your own branded consent screen — check whether that matters for your audience.
Verifying it works
Test on both your Preview URL and your published custom domain if you have one — OAuth redirect settings are often domain-specific.
Related: /questions/how-do-i-add-login-to-lovable, /questions/why-isn-t-my-login-working.
Sources
Was this answer helpful?
Related questions
- AnswerHow do I add password reset?Ask Lovable to add a "forgot password" flow — it uses Lovable Cloud's authentication to email a reset link and lets the user set a new password.
- AnswerHow do I add login to Lovable?Ask Lovable to add authentication — it enables Lovable Cloud (if not already on), then generates sign-up/login pages and wires them to email, Google, or other providers.
- AnswerHow do I create admin users?Add a `user_roles` table with an `admin` role, assign it to the specific user's ID, and check that role server-side (in RLS policies and any admin-only functions) rather than trusting a front-end flag.
- AnswerWhy does my app keep redirecting to login?This is almost always a session or route-guard bug: either the auth session isn't persisting, or a protected route checks auth state before it's loaded, so it bounces back to login even when signed in.
You might also need
- GuideHow to Create Protected PagesRestrict routes to signed-in users properly — including the server-side check most AI-generated guards miss.
- GuideHow to Add User Login to a Lovable ProjectSign-up, sign-in, sign-out and sessions — plus the settings people forget that break login on the live site.
- GuideHow to Add User Roles and PermissionsAdmin, editor and member roles done safely — stored separately from user profiles so they cannot be escalated.