File tree 4 files changed +15
-0
lines changed
4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -298,10 +298,20 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
298
298
redirectTo: widget.redirectTo,
299
299
);
300
300
widget.onPasswordResetEmailSent? .call ();
301
+ context.showSnackBar (localization.passwordResetSent);
302
+ setState (() {
303
+ _forgotPassword = false ;
304
+ });
301
305
} on AuthException catch (error) {
302
306
widget.onError? .call (error);
303
307
} catch (error) {
304
308
widget.onError? .call (error);
309
+ } finally {
310
+ if (mounted) {
311
+ setState (() {
312
+ _isLoading = false ;
313
+ });
314
+ }
305
315
}
306
316
},
307
317
child: Text (localization.sendPasswordReset),
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ class _SupaResetPasswordState extends State<SupaResetPassword> {
78
78
),
79
79
);
80
80
widget.onSuccess.call (response);
81
+ context.showSnackBar (localization.passwordResetSent);
81
82
} on AuthException catch (error) {
82
83
if (widget.onError == null && context.mounted) {
83
84
context.showErrorSnackBar (error.message);
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class SupaEmailAuthLocalization {
9
9
final String dontHaveAccount;
10
10
final String haveAccount;
11
11
final String sendPasswordReset;
12
+ final String passwordResetSent;
12
13
final String backToSignIn;
13
14
final String unexpectedError;
14
15
@@ -24,6 +25,7 @@ class SupaEmailAuthLocalization {
24
25
this .dontHaveAccount = 'Don\' t have an account? Sign up' ,
25
26
this .haveAccount = 'Already have an account? Sign in' ,
26
27
this .sendPasswordReset = 'Send password reset email' ,
28
+ this .passwordResetSent = 'Password reset email has been sent' ,
27
29
this .backToSignIn = 'Back to sign in' ,
28
30
this .unexpectedError = 'An unexpected error occurred' ,
29
31
});
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ class SupaResetPasswordLocalization {
3
3
final String passwordLengthError;
4
4
final String updatePassword;
5
5
final String unexpectedError;
6
+ final String passwordResetSent;
6
7
7
8
const SupaResetPasswordLocalization ({
8
9
this .enterPassword = 'Enter your password' ,
9
10
this .passwordLengthError =
10
11
'Please enter a password that is at least 6 characters long' ,
11
12
this .updatePassword = 'Update Password' ,
12
13
this .unexpectedError = 'An unexpected error occurred' ,
14
+ this .passwordResetSent = 'Password reset email has been sent' ,
13
15
});
14
16
}
You can’t perform that action at this time.
0 commit comments