Skip to content

Commit 983602c

Browse files
committed
FIX #88
1 parent a77b19f commit 983602c

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

lib/src/components/supa_email_auth.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,20 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
298298
redirectTo: widget.redirectTo,
299299
);
300300
widget.onPasswordResetEmailSent?.call();
301+
context.showSnackBar(localization.passwordResetSent);
302+
setState(() {
303+
_forgotPassword = false;
304+
});
301305
} on AuthException catch (error) {
302306
widget.onError?.call(error);
303307
} catch (error) {
304308
widget.onError?.call(error);
309+
} finally {
310+
if (mounted) {
311+
setState(() {
312+
_isLoading = false;
313+
});
314+
}
305315
}
306316
},
307317
child: Text(localization.sendPasswordReset),

lib/src/components/supa_reset_password.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class _SupaResetPasswordState extends State<SupaResetPassword> {
7878
),
7979
);
8080
widget.onSuccess.call(response);
81+
context.showSnackBar(localization.passwordResetSent);
8182
} on AuthException catch (error) {
8283
if (widget.onError == null && context.mounted) {
8384
context.showErrorSnackBar(error.message);

lib/src/localizations/supa_email_auth_localization.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class SupaEmailAuthLocalization {
99
final String dontHaveAccount;
1010
final String haveAccount;
1111
final String sendPasswordReset;
12+
final String passwordResetSent;
1213
final String backToSignIn;
1314
final String unexpectedError;
1415

@@ -24,6 +25,7 @@ class SupaEmailAuthLocalization {
2425
this.dontHaveAccount = 'Don\'t have an account? Sign up',
2526
this.haveAccount = 'Already have an account? Sign in',
2627
this.sendPasswordReset = 'Send password reset email',
28+
this.passwordResetSent = 'Password reset email has been sent',
2729
this.backToSignIn = 'Back to sign in',
2830
this.unexpectedError = 'An unexpected error occurred',
2931
});

lib/src/localizations/supa_reset_password_localization.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ class SupaResetPasswordLocalization {
33
final String passwordLengthError;
44
final String updatePassword;
55
final String unexpectedError;
6+
final String passwordResetSent;
67

78
const SupaResetPasswordLocalization({
89
this.enterPassword = 'Enter your password',
910
this.passwordLengthError =
1011
'Please enter a password that is at least 6 characters long',
1112
this.updatePassword = 'Update Password',
1213
this.unexpectedError = 'An unexpected error occurred',
14+
this.passwordResetSent = 'Password reset email has been sent',
1315
});
1416
}

0 commit comments

Comments
 (0)