Short answer
When updateUser returns this code, call supabase.auth.reauthenticate() to send a one-time code to the user’s email, or phone if there is no confirmed email. Ask for the code, then call updateUser again with the new password and the code as nonce. Users who signed in within 24 hours skip this step.
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why Supabase asks again, and the fix
01
The session is older than 24 hours
“A user is deemed recently signed in if the session was created in the last 24 hours.” Supabase docs, JavaScript reference: reauthenticate
Apps that keep users signed in across days hit this code on the change-password screen. Catch it and start the code step instead of showing a generic error.
const { error } = await supabase.auth.updateUser({ password: newPassword }); if (error?.code === 'reauthentication_needed') { await supabase.auth.reauthenticate(); const nonce = await askUserForCode(); await supabase.auth.updateUser({ password: newPassword, nonce }); }02
The code is not passed back
“After receiving the OTP, include it as the nonce in your updateUser() call to finalize the password change.” Supabase docs, JavaScript reference: reauthenticate
reauthenticate only sends the code. The password change finishes only when the same code goes into updateUser as nonce.
03
The code was mistyped
“Verifying a reauthentication failed, the code is incorrect.” Supabase docs, Auth error codes (reauthentication_not_valid)
A wrong code returns reauthentication_not_valid, a different code. Let the user ask for a new code and try again.
04
The setting changed between projects
Also check: Secure password change is a per-project Auth setting. A staging project without it accepts the change, and production with it on returns this code.
Checked against the vendor’s docs on : Supabase docs: Auth error codes; Supabase docs: JavaScript reference, reauthenticate; Supabase Auth source: user.go (password update).
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Supabase same_password · Supabase weak_password · Supabase mfa_verification_failed · Supabase PGRST200