@@ -57,6 +57,12 @@ class SupaEmailAuth extends StatefulWidget {
57
57
/// confirmation link after signing up.
58
58
final String ? redirectTo;
59
59
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
+
60
66
/// Callback for the user to complete a sign in.
61
67
final void Function (AuthResponse response) onSignInComplete;
62
68
@@ -87,6 +93,7 @@ class SupaEmailAuth extends StatefulWidget {
87
93
const SupaEmailAuth ({
88
94
super .key,
89
95
this .redirectTo,
96
+ this .resetPasswordRedirectTo,
90
97
required this .onSignInComplete,
91
98
required this .onSignUpComplete,
92
99
this .onPasswordResetEmailSent,
@@ -295,7 +302,8 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
295
302
final email = _emailController.text.trim ();
296
303
await supabase.auth.resetPasswordForEmail (
297
304
email,
298
- redirectTo: widget.redirectTo,
305
+ redirectTo:
306
+ widget.resetPasswordRedirectTo ?? widget.redirectTo,
299
307
);
300
308
widget.onPasswordResetEmailSent? .call ();
301
309
// FIX use_build_context_synchronously
0 commit comments