File tree 1 file changed +5
-6
lines changed
packages/firebase_ui_auth/lib/src/widgets
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,8 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
85
85
void Function () pop <T >(BuildContext context, T result) =>
86
86
() => Navigator .of (context).pop (result);
87
87
88
- Future <void > _deleteAccount () async {
89
- bool ? confirmed = ! widget.showDeleteConfirmationDialog;
88
+ Future <void > _deleteAccount ({ bool skipConfirmation = false } ) async {
89
+ bool ? confirmed = skipConfirmation || ! widget.showDeleteConfirmationDialog;
90
90
91
91
if (! confirmed) {
92
92
final l = FirebaseUILocalizations .labelsOf (context);
@@ -116,17 +116,16 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
116
116
final user = auth.currentUser! ;
117
117
await auth.currentUser? .delete ();
118
118
119
- FirebaseUIAction .ofType <AccountDeletedAction >(context) ? . callback (
119
+ FirebaseUIAction .ofType <AccountDeletedAction >(
120
120
context,
121
- user,
122
- );
121
+ )? .callback (context, user);
123
122
await FirebaseUIAuth .signOut (context: context, auth: auth);
124
123
} on fba.FirebaseAuthException catch (err) {
125
124
if (err.code == 'requires-recent-login' ) {
126
125
if (widget.onSignInRequired != null ) {
127
126
final signedIn = await widget.onSignInRequired !();
128
127
if (signedIn) {
129
- await _deleteAccount ();
128
+ await _deleteAccount (skipConfirmation : true );
130
129
}
131
130
}
132
131
}
You can’t perform that action at this time.
0 commit comments