Common Issuesauth

Login or Signup Not Working in My AI App

Can't log in or sign up in your Lovable, Bolt or Base44 app? The most common authentication causes and what to check first.

4 min read Updated Applies to Common Issues

What is going on

Users try to log in or create an account and something goes wrong. It shows an error, nothing happens at all, or the page sends them back to the login screen in a loop.

Authentication has several parts that all have to agree: the sign-in service, the list of allowed web addresses, the keys, the email sender, and the rules on your database. AI tools set these up quickly, and a change in one place (a new domain, a new key, a new table) often breaks the login without any visible error. The first job is to find which kind of failure you have.

Error messages you might see

Invalid login credentials
Email not confirmed
User already registered
Failed to fetch
401 Unauthorized
redirect_uri_mismatch
Auth session missing
Email rate limit exceeded

Common causes

  1. The address your app runs on is not on the sign-in service's list of allowed redirect addresses. This is the usual cause after moving from a preview link to your own domain, or switching between http and https, or www and non-www.
  2. Email confirmation is switched on, but the confirmation emails never arrive. Built-in email senders are often limited to a few messages an hour, and unconfirmed users cannot sign in.
  3. The keys or project address in production are different from the ones that worked in the preview, or they were never added to the hosting service.
  4. The session is not kept: cookies are blocked, the app runs inside an iframe, or the cookie belongs to a different domain than the page.
  5. The account is created, but the app then fails to read or write the user's profile row because a database rule (for example Supabase row level security) blocks it.
  6. Google or GitHub sign-in fails because the redirect address registered with Google or GitHub does not match exactly.
  7. The page checks whether you are signed in before the saved session has loaded, decides you are not, and redirects you to login again.

How to fix it

  1. Open your browser's developer tools (F12), go to the Network tab, and try to log in. Find the request that fails and note its status. 400 or 401 usually means wrong credentials or keys, 403 means a permission rule, 422 means the data was rejected, 429 means you hit a rate limit.
  2. Compare the exact address in your browser with the allowed redirect list in your sign-in service. Check http versus https, www, a trailing slash, and the preview versus the live domain. Add the live address to both the site URL and the redirect list.
  3. If email confirmation is on, check the spam folder and the service's email log. For real users, connect your own email sender (SMTP) instead of the built-in one, or turn confirmation off while you test.
  4. Compare the sign-in keys and project address in production with the ones in the working environment. After changing them, redeploy.
  5. Try a private browser window to rule out an old saved session or blocked cookies.
  6. After a signup, check that the user's profile row exists. If it does not, look at the database rules for the table that stores it.
  7. For Google or GitHub sign-in, copy the redirect address your app uses and make sure the same address is registered in the Google or GitHub developer settings.

Getting help takes about a minute

No hiring, no back and forth. A real person looks at your app.

  1. 1

    Describe it

    Tell us what you need in plain words. You don't have to be technical or have an account to start.

  2. 2

    Free 15-minute call

    A verified developer calls you. Many tasks are sorted right there, and it costs nothing.

  3. 3

    Pay after you approve

    If there is more to do, you get one fixed price up front. You pay only once you are happy.

Get help

Real people, reviewed by hand

Developers who do this every day

Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.

Get help

Questions

Why does login work in the preview but not on my own domain?

The sign-in service only accepts the web addresses on its list. A new domain has to be added there, and the keys in production may also differ from the ones in the preview.

Users say they never got the confirmation email. What now?

Check the spam folder and the sending log first. The built-in sender is limited, so connect your own email provider for real users.

Why does the app send me back to the login page after I sign in?

The page probably checks for a session before it has loaded, or the session cookie is not saved. Look at the Network and Application tabs in the developer tools to see whether the session is stored.

Keep reading

Can't fix it yourself?
Real developers can help.

Get help