Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
void Function() pop<T>(BuildContext context, T result) =>
() => Navigator.of(context).pop(result);

Future<void> _deleteAccount() async {
bool? confirmed = !widget.showDeleteConfirmationDialog;
Future<void> _deleteAccount({bool skipConfirmation = false}) async {
bool? confirmed = skipConfirmation || !widget.showDeleteConfirmationDialog;

if (!confirmed) {
final l = FirebaseUILocalizations.labelsOf(context);
Expand Down Expand Up @@ -116,17 +116,16 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
final user = auth.currentUser!;
await auth.currentUser?.delete();

FirebaseUIAction.ofType<AccountDeletedAction>(context)?.callback(
FirebaseUIAction.ofType<AccountDeletedAction>(
context,
user,
);
)?.callback(context, user);
await FirebaseUIAuth.signOut(context: context, auth: auth);
} on fba.FirebaseAuthException catch (err) {
if (err.code == 'requires-recent-login') {
if (widget.onSignInRequired != null) {
final signedIn = await widget.onSignInRequired!();
if (signedIn) {
await _deleteAccount();
await _deleteAccount(skipConfirmation: true);
}
}
}
Expand Down
Loading