@@ -57,6 +57,12 @@ class SupaEmailAuth extends StatefulWidget {
5757 /// confirmation link after signing up.
5858 final String ? redirectTo;
5959
60+ /// The URL to redirect the user to when clicking on the link on the
61+ /// password recovery link.
62+ ///
63+ /// If unspecified, the [redirectTo] value will be used.
64+ final String ? resetPasswordRedirectTo;
65+
6066 /// Callback for the user to complete a sign in.
6167 final void Function (AuthResponse response) onSignInComplete;
6268
@@ -93,6 +99,7 @@ class SupaEmailAuth extends StatefulWidget {
9399 const SupaEmailAuth ({
94100 super .key,
95101 this .redirectTo,
102+ this .resetPasswordRedirectTo,
96103 required this .onSignInComplete,
97104 required this .onSignUpComplete,
98105 this .onPasswordResetEmailSent,
@@ -308,7 +315,8 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
308315 final email = _emailController.text.trim ();
309316 await supabase.auth.resetPasswordForEmail (
310317 email,
311- redirectTo: widget.redirectTo,
318+ redirectTo:
319+ widget.resetPasswordRedirectTo ?? widget.redirectTo,
312320 );
313321 widget.onPasswordResetEmailSent? .call ();
314322 // FIX use_build_context_synchronously
0 commit comments