© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
FunHellion

Password Recovery

Hi there 👋

I am working on password recovery in React and it's well documented how that is supposed to work but for some reason it is not working for me.

The example shows that using the
onAuthStateChange 
onAuthStateChange 
event is the way to handle incomming recovery requests.

I tried putting a
console.log
console.log
in there so I could see if the event even happens, but it just does not show up.

useEffect(() => {
  supabase.auth.onAuthStateChange(async (event, session) => {
    console.log('AUTH STATE CHANGE', event, session);

    if (event === 'PASSWORD_RECOVERY') {
      alert('It works');
    }
  });
}, []);
useEffect(() => {
  supabase.auth.onAuthStateChange(async (event, session) => {
    console.log('AUTH STATE CHANGE', event, session);

    if (event === 'PASSWORD_RECOVERY') {
      alert('It works');
    }
  });
}, []);


Any ideas on what might be wrong?

https://supabase.com/docs/reference/javascript/auth-api-resetpasswordforemail#reset-password-react
resetPasswordForEmail() | Supabase
Sends a reset request to an email address.
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 NextJS Password Recovery
SupabaseSSupabase / help-and-questions
4y ago
Send password recovery, or reset password is not sending an email.
SupabaseSSupabase / help-and-questions
3y ago
Password reset link emits sign_in event instead of password_recovery...
SupabaseSSupabase / help-and-questions
4y ago
How do I update the recovery password on the SSR ?
SupabaseSSupabase / help-and-questions
5mo ago