Supabase password reset link says expired or invalid: how to fix it

By Arif Khan, AIVolve LLC · Updated November 20, 2026

"My users click the reset password link in the email and get 'Email link is invalid or has expired', even when they click it right away. Other times it just logs them in and drops them on the home page with no new password form. Why doesn't Supabase password reset work?"

Short answer: a Supabase reset link works once, for a limited time (1 hour by default), and only for the newest email. The most common cause of "Email link is invalid or has expired" on the first click is that something opened the link before your user did, usually a company email scanner, and Supabase's own help article names this as the most common reason. The other causes are a second reset request that cancelled the first link, a link opened in a different browser than the one that asked for it, and a reset link that lands on a page that is not on your Redirect URLs list, so Supabase sends people to your Site URL instead of your new password page. Each one has a clear sign and a fix below. The sturdiest fix is to stop the link from doing the work: send a 6-digit code, or link to your own page where a button finishes the reset.

What the error looks like

When a reset link fails, Supabase sends the user to your app with the error in the address, like this:

/update-password#error=access_denied&error_code=otp_expired&error_description=Email+link+is+invalid+or+has+expired

Supabase uses the same otp_expired code whether the link was already used, replaced by a newer one, or too old. So the error alone does not tell you which. The table does.

What you see Most likely cause Fix
otp_expired on the very first click, often for people on company email An email scanner opened the link first Cause 1
otp_expired after the user asked for a reset twice Only the newest email works Cause 2
otp_expired hours after the email was sent The link is older than the expiry Cause 3
"PKCE code verifier not found in storage" Link opened in a different browser or device Cause 4
Link signs the user in but lands on the home page or localhost Reset page missing from Redirect URLs Cause 5
"Auth session missing!" when saving the new password The page tried to save before the reset session existed Cause 6
No email arrives at all Email sending limits or the default sender Before you start

Before you start: is the email arriving?

If no email arrives, nothing below matters yet. Two Supabase defaults catch people:

Also, Supabase does not tell you when an address has no account. The reset call returns no error and simply sends nothing, which protects your users' privacy. If you are on Lovable Cloud, Lovable's docs say password reset emails use your project's email templates under More → Emails, and a setting called Rate limit for sending emails caps how many auth emails your project sends in an hour.

The 6 causes and the fix for each

1. A scanner opened the link before your user did. Supabase's email templates guide says some email providers prefetch links in incoming mail to check them, for example Safe Links in Microsoft Defender for Office 365, and that this consumes the link instantly. Your user then clicks a link that was already used. Supabase's help article calls email prefetching the most common reason tokens look expired before the user can use them. How to confirm it: in your Supabase project, check the API logs for 403 responses on /verify that appear within seconds of the email being sent. The fix is to make the link harmless to open. Pick one:

2. Your user asked for a second reset email. Only the newest link works. When Supabase Auth creates a new reset token, it first deletes the user's existing one of the same type, so the first email's link stops working. We confirmed this on a local Supabase Auth server: the older link returned otp_expired and the newest one worked. Fix: on your "forgot password" screen, say "Use the newest email, older links stop working", and do not send a reset email automatically on page load or on every click.

3. The link is older than the expiry. Supabase's docs say email links and codes expire after 1 hour by default. The setting is Email OTP expiration, under Authentication, Sign In / Providers, Email, and it covers password reset links too. Supabase strongly discourages more than a day. Fix: keep the default, and show a clear "This link has expired. Send a new one" message with a button on the page the error lands on, instead of a blank page.

4. The link was opened in a different browser or device. This one only applies if your app uses the PKCE flow (Next.js and other server-rendered setups do; the plain JavaScript client uses the older implicit flow unless you change it). With PKCE, the browser that asked for the reset keeps a secret, and only that browser can finish the reset. Open the email on your phone after asking on your laptop, and supabase-js reports: "PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared." The code in a PKCE link is also valid for only 5 minutes and works once. Fix: use the button page or the 6-digit code from cause 1. Both work on any device, because they verify the token hash or code directly instead of needing the saved secret. Supabase's own PKCE reset example does exactly this.

5. The link lands on the wrong page. Your app passes a redirectTo address when it asks for the reset, for example https://yourapp.com/update-password. Supabase only uses it if it matches your Redirect URLs list. If it does not match, Supabase quietly sends the user to your Site URL instead, which defaults to http://localhost:3000. We confirmed this locally: an address that was not on the list came back in the email as the Site URL. The user is signed in, but lands on your home page (or localhost) and never sees the new password form. Fix: add the exact reset page address for every domain you use (custom domain, www, the default app address) under Authentication, URL Configuration in Supabase. On Lovable Cloud, Lovable's docs say it keeps the Site URL and Redirect URLs up to date for its own addresses, and you can see the full list under More → Users → Settings → Advanced → Redirect URLs; addresses Lovable does not serve are yours to add.

6. "Auth session missing!" when the user saves the new password. Saving the new password calls updateUser, and that only works for someone who is signed in through the reset link. If your page runs before the link has been turned into a session, or the link already failed with one of the causes above, supabase-js returns "Auth session missing!". Fix: show the new password form only after Supabase confirms the reset. In supabase-js, listen for the PASSWORD_RECOVERY event, which fires instead of SIGNED_IN when someone arrives from a reset link, or check for a session first. If there is no session, show "This link has expired. Send a new one".

The sturdy fix: a button page or a 6-digit code

Both options below were tested on a local Supabase Auth server. Each verifies once, and a second attempt returns otp_expired, so they are as safe as the default link.

Option A: link to your own page with a button. In Supabase, open the Reset Password email template and point the link at your page, carrying the token hash:

<h2>Reset your password</h2>
<p>Follow the link below, then press the button to choose a new password.</p>
<p><a href="{{ .SiteURL }}/reset-password?token_hash={{ .TokenHash }}&type=recovery">Reset password</a></p>

On that page, verify only when the person presses the button:

// reset-password page: nothing happens until the person presses the button
const params = new URLSearchParams(window.location.search)

async function onContinueClick() {
  const { error } = await supabase.auth.verifyOtp({
    token_hash: params.get('token_hash'),
    type: 'recovery',
  })
  if (error) {
    // error.code is 'otp_expired' for a used, replaced or old link
    showMessage('This link has expired. Send a new one.')
    return
  }
  showNewPasswordForm() // the person is now signed in for the reset
}

async function onSaveNewPassword(newPassword) {
  const { error } = await supabase.auth.updateUser({ password: newPassword })
  if (error) showMessage(error.message)
}

Option B: send a 6-digit code. Put {{ .Token }} in the Reset Password email template ("Your code is {{ .Token }}"). In your app, ask for the email address and the code, then:

const { error } = await supabase.auth.verifyOtp({ email, token: code, type: 'recovery' })
// then call supabase.auth.updateUser({ password: newPassword }) as above

If your app also uses magic links or signup confirmation links, the same scanner problem applies to them, and the same two options work.

How to confirm it's fixed

  1. Request a reset for a test account and open the link in a different browser than the one you used to ask. It should work.
  2. Open the same link a second time. You should see your "This link has expired. Send a new one" message, not a blank page or an error dump.
  3. Request two resets in a row. The first email should fail with that message, the second should work.
  4. Save a new password, sign out, and sign in with it.
  5. If your users are on company email (Outlook or Microsoft 365), ask one of them to try it. That is where scanners show up.

A prompt for Lovable, Cursor or Claude Code

Check this app's password reset flow. Do not change anything yet. 1. Find every call to resetPasswordForEmail and show me the redirectTo address each one uses. 2. Tell me which page handles the reset link, and whether it waits for the PASSWORD_RECOVERY event or a session before showing the new password form. 3. Tell me whether this app uses the PKCE flow or the implicit flow. 4. Tell me what a user sees if the link has expired or was already used (error_code=otp_expired in the address). Then propose the smallest change so the reset email links to a page with a button that calls verifyOtp with the token hash and type recovery, or sends a 6-digit code instead. List the exact Redirect URLs I need to add. Never print a key or secret value. Wait for my approval.

FAQ

Why does my Supabase reset link say it has expired when I click it right away?+

Most often because something opened the link first. Supabase's docs say some email providers and security tools, such as Safe Links in Microsoft Defender for Office 365, open links in incoming mail to check them, which uses up the one-time link. Send a 6-digit code instead, or link to your own page where a button finishes the reset.

How long is a Supabase password reset link valid?+

1 hour by default. Supabase's docs say email links and codes expire after 1 hour unless you change Email OTP expiration in your Auth settings, and they strongly discourage more than one day. Each link also works only once, and only the newest reset email works.

Why does my Supabase reset link take users to the home page or localhost?+

The reset page address your app sends is probably not on your Redirect URLs list, so Supabase falls back to your Site URL, which defaults to localhost:3000. Add the exact reset page address for every domain you use under URL Configuration in Supabase, and set the Site URL to your live address.

What does "Auth session missing!" mean when updating a password in Supabase?+

It means your app called updateUser before the person was signed in through the reset link, or the link had already failed. Show the new password form only after the PASSWORD_RECOVERY event fires or a session exists, and otherwise offer to send a new link.

Why does my reset link only work on the device where I asked for it?+

Your app uses the PKCE flow, where only the browser that asked for the reset can finish it. supabase-js reports "PKCE code verifier not found in storage" on any other browser or device. Linking to a page with a button that calls verifyOtp with the token hash, or sending a 6-digit code, works on any device.

Want a second pair of eyes?

If password resets are failing, other parts of sign-in usually need a look too. Our free X-ray takes about 2 minutes and needs no code or passwords. You get a plain-English verdict, and an AIVolve developer reviews every one within 1 business day. Get a free X-ray →

Related: Lovable + Supabase login loop: the real fix · Lovable Cloud vs your own Supabase · Supabase anon key vs service_role key · Supabase "Database error deleting user": the fix

Written by Arif Khan, AIVolve LLC. VibeCoderSOS isn't affiliated with Supabase or Lovable. Based on Supabase's documentation and source code, checked on November 20, 2026. We reproduced every error on this page on a local Supabase Auth server (v2.198.0) with supabase-js 2.119.2; your hosted project's settings may differ.

Need help?

Not sure what else in your sign-in flow only looks finished? A free X-ray tells you what works, what only looks done and what to fix first.

Get a free X-ray →