flutter-auth-ui icon indicating copy to clipboard operation
flutter-auth-ui copied to clipboard

onToggleRecoverPassword not called when tapping “Back to sign in”, causing persistent “Recover Password” state

Open m-pastuszek opened this issue 3 months ago • 0 comments

Bug report

Describe the bug

When using SupaEmailAuth, the onToggleRecoverPassword callback is correctly invoked with true after tapping “Forgot password”. However, tapping “Back to sign in” does not trigger onToggleRecoverPassword with false. As a result, the parent widget remains in the “Recover Password” state (e.g., the screen title or other UI driven by this callback stays stuck on password reset).

To Reproduce

SupaEmailAuth(
  onToggleSignIn: (isSignIn) {
    debugPrint('isSignIn: $isSignIn');
  },
  onToggleRecoverPassword: (isRecoverPassword) {
    debugPrint('isRecoverPassword: $isRecoverPassword');
  }
);

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Render SupaEmailAuth with both onToggleSignIn and onToggleRecoverPassword callbacks and drive parent UI state based on them.
  2. Tap “Forgot password” to enter the password recovery flow.
  3. Observe onToggleRecoverPassword (true) is called.
  4. Tap “Back to sign in”.
  5. Observe onToggleRecoverPassword (false) is not called.

Expected behavior

Tapping “Back to sign in” should invoke onToggleRecoverPassword(false), allowing the parent widget to update its UI and exit the password recovery state.

m-pastuszek avatar Sep 01 '25 21:09 m-pastuszek