Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a dedicated redirect url parameter for a password reset flow #97

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/src/components/supa_email_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class SupaEmailAuth extends StatefulWidget {
/// confirmation link after signing up.
final String? redirectTo;

/// The URL to redirect the user to when clicking on the link on the
/// confirmation link from a reset password confirm email.
final String? redirectToResetPwd;

/// Callback for the user to complete a sign in.
final void Function(AuthResponse response) onSignInComplete;

Expand Down Expand Up @@ -87,6 +91,7 @@ class SupaEmailAuth extends StatefulWidget {
const SupaEmailAuth({
Key? key,
this.redirectTo,
this.redirectToResetPwd,
required this.onSignInComplete,
required this.onSignUpComplete,
this.onPasswordResetEmailSent,
Expand Down Expand Up @@ -295,7 +300,7 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
final email = _emailController.text.trim();
await supabase.auth.resetPasswordForEmail(
email,
redirectTo: widget.redirectTo,
redirectTo: widget.redirectToResetPwd,
);
widget.onPasswordResetEmailSent?.call();
// FIX use_build_context_synchronously
Expand Down
Loading