UrgisoftAI-built apps

AI-built apps ยท November 2026

Fix login and Supabase errors in your Lovable or Bolt app

Short answer: nearly every login problem in an app built with Lovable or Bolt comes from a setting outside the code: Supabase's list of allowed addresses, Google's sign-in settings, Supabase's email sender, or the table permissions (row level security). Find your symptom below; each one has a fix you can check in a few minutes.

Match the symptom

Open the browser's console (right-click the page, Inspect, Console) and try to log in. The red line, or the address you land on, tells you which one it is:

What you seeCause
After logging in, or clicking the email link, you land on localhost:3000 or the builder's preview address1. The live address is not in Supabase's allowed list
Google says Error 400: redirect_uri_mismatch2. Google does not know Supabase's return address
The sign-up email never arrives, or email rate limit exceeded3. Supabase's built-in email sender is for testing only
Database error saving new user when someone signs up4. The script that creates the user's profile fails
Logged in, but lists are empty, or new row violates row-level security policy5. Row level security blocks the user
Refreshing the page logs you out, or sends you to the login page for a moment6. The app checks the session before it has loaded
Invalid API key, Failed to fetch, or every request to Supabase fails7. Wrong settings on the host, or a paused project

The seven causes, and the fix for each

  1. The live address is not in Supabase's allowed list. Supabase only sends people back to addresses it knows. When the live address is missing, it falls back to the Site URL, which is often still http://localhost:3000 or the builder's preview.
    Fix: in Supabase, Authentication, URL Configuration, set the Site URL to your live address (for example https://yourapp.com) and add it under Redirect URLs with /** at the end so every page counts (https://yourapp.com/**). Keep the preview address there too if you still test in the builder. In the code, any emailRedirectTo or redirectTo should use window.location.origin, not a fixed address.
  2. Google does not know Supabase's return address. With Google sign-in, Google sends the person to Supabase first, and only then to your app. Google refuses any return address that is not on its list.
    Fix: in Google Cloud Console, APIs & Services, Credentials, open your OAuth client and add https://<your-project>.supabase.co/auth/v1/callback under Authorized redirect URIs (Supabase shows the exact address on its Google provider page). Add your live address under Authorized JavaScript origins. Your own app's address goes in Supabase's Redirect URLs (cause 1), not in Google's list. While the Google app is in Testing mode, only the test users you listed can sign in.
  3. Supabase's built-in email sender is for testing only. It sends only a few emails an hour and, on current projects, only to the addresses of your own Supabase team. Real users never get their confirmation email, so they cannot log in (Email not confirmed).
    Fix: in Supabase, Authentication, add your own email sender (SMTP) from a mail service such as Resend, Postmark or Amazon SES, with an address on your own domain, then raise the email rate limit. While you test, you can turn off Confirm email under the Email provider, but turn it back on before real users arrive.
  4. The script that creates the user's profile fails. Builders often add a database function that copies each new user into a profiles table. If that function breaks (a required column it does not fill, a misspelled column, a table it cannot see), Supabase cancels the whole sign-up and shows only this short message.
    Fix: in Supabase, open the Postgres logs at the time of a failed sign-up; the real error is there. Fix the function to match the table: give columns a default or let them be empty, and define the function with security definer and set search_path = public, writing the table as public.profiles.
  5. Row level security blocks the user. With row level security on and no rule that lets a user read their own rows, Supabase returns an empty list with no error. Saving fails with new row violates row-level security policy (code 42501), often because the rule checks auth.uid() = user_id and the app never fills user_id.
    Fix: add a rule per table and action, for example "users can read their own rows" with using (auth.uid() = user_id), and give inserts the same check with with check. Give user_id a default in the table (default auth.uid()) so the app cannot forget it. Never fix this by turning row level security off: a table without it can be read and changed by anyone who opens your site, because the key in the browser is public by design. Supabase marks such tables "Unrestricted".
  6. The app checks the session before it has loaded. On a refresh, Supabase needs a moment to read the saved session. A page guard that runs first sees "no user" and sends the person to the login page.
    Fix: keep a loading state until the first answer arrives; subscribe with supabase.auth.onAuthStateChange once, at the top of the app, and only redirect after the loading state ends. Create the Supabase client once, in one file, not inside a component. If the console shows Invalid Refresh Token, the saved session is old: sign out and in again; if it keeps coming back, two clients are fighting over the same session.
  7. Wrong settings on the host, or a paused project. On your own host the app needs VITE_SUPABASE_URL and the anon key under exactly the names the code reads; a missing or misspelled one gives Invalid API key or requests to undefined. Separately, Supabase pauses free projects after about a week without activity, and every request then fails.
    Fix: compare the host's environment variables with the names the code reads (search for import.meta.env.), then deploy again, since these values are built in at deploy time. If the Supabase dashboard says the project is paused, restore it there. The steps for the host are on our deploy page.

This is a checklist from engineering practice, not a study: we have not counted how often each cause happens. The messages are the tools' own wording and can differ a little between versions, and Supabase and Google rename their menus from time to time. It covers React apps with Supabase sign-in, which is what Lovable and Bolt set up by default.

Other problems

The app shows nothing at all? A blank page after publishing: six causes and the fix for each. Moving it to your own host? Deploy to Vercel or Netlify: the steps, and six errors that stop it. Slow on phones? Our demo shop, measured before and after: 14.5 s to 1.4 s.

Want it fixed for you?

We fix apps made with Lovable, Bolt, Replit, Cursor and other AI builders, in your own code, and tell you in plain words what was wrong. Fixed prices on Fiverr: one bug from $40, up to five bugs with the app deployed and working live from $150. No fix, no charge. A GitHub invite is enough; we never ask for passwords.

See the gig on Fiverr