© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
4 replies
BaptisteS

Reset user password Flutter / Next.js / Supabase

Hey,
I'm currently working on the reset password feature for my flutter mobile app.

On the mobile app, I've got a dedicated page with the email field and a button. This button calls:
client.auth.resetPasswordForEmail(
      email,
      redirectTo: _env.recoverPasswordUrl,
)
client.auth.resetPasswordForEmail(
      email,
      redirectTo: _env.recoverPasswordUrl,
)


The email is well sent will this template configured on Supabase interface following the doc:
<h2>Réinitialisation de votre mot de passe</h2>

<p>Suivez ce lien pour réinitialiser votre mot de passe:</p>
<p><a
    href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/reset-password"
    >Reset Password</a
  ></p>
<h2>Réinitialisation de votre mot de passe</h2>

<p>Suivez ce lien pour réinitialiser votre mot de passe:</p>
<p><a
    href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/reset-password"
    >Reset Password</a
  ></p>


Then i receive the email and click on the link that redirect on a very simple nextjs app, with a new password field and a confirm button calling updateUser(newPassword).

I've test various things: intermédiate route to get the code and initiate the session then redirect to the new password form page or navigating directly to this page but none works: I get session error or code empty...

What should i use: exchangeCodeForSession, verifyOtp with recovery type and which code/otp is the good one from the email link url? ["code"], ["tokenHash"]...

Thank you in advance!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase Reset Password flow for Next.js
SupabaseSSupabase / help-and-questions
2w ago
Flutter Reset Password Problem
SupabaseSSupabase / help-and-questions
13mo ago
Supabase auth next.js
SupabaseSSupabase / help-and-questions
4y ago
SupabaseAuthState in Flutter
SupabaseSSupabase / help-and-questions
4y ago