Update password (not reset password page)

Hi everyone đź‘‹
I'm working on a password update feature using Supabase Auth in my Next.js app.

The password update itself works perfectly — Supabase updates the password and I can log in again with the new one.

However, the current session becomes invalid right after the password change, but Supabase doesn't automatically sign out the user. So on the frontend, the user still appears logged in, but any API calls fail with “Invalid JWT”.

I’ve tried calling supabase.auth.signOut() or refreshing the session after the update, but it doesn’t seem to take effect — the button stays on “Updating...” and the session event log still shows “Session active”.

How can I properly handle this situation and force a clean logout (or session refresh) right after a successful password update?

Thanks a lot for your help 🙏
code.png
Was this page helpful?