From 7eaefaba492864cbcfd29a9af91d3bcb42ed9e6b Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 9 Dec 2025 12:13:58 -0500 Subject: [PATCH] fix: use UIARequest for account deletion to enable deletion of SSO accounts --- .../settings_security/settings_security.dart | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/lib/pages/settings_security/settings_security.dart b/lib/pages/settings_security/settings_security.dart index b8aa2584f..e55d4c3c2 100644 --- a/lib/pages/settings_security/settings_security.dart +++ b/lib/pages/settings_security/settings_security.dart @@ -102,30 +102,47 @@ class SettingsSecurityController extends State { if (mxid == null || mxid.isEmpty || mxid != supposedMxid) { return; } - final input = await showTextInputDialog( - useRootNavigator: false, + // #Pangea + // final input = await showTextInputDialog( + // useRootNavigator: false, + // context: context, + // title: L10n.of(context).pleaseEnterYourPassword, + // okLabel: L10n.of(context).ok, + // cancelLabel: L10n.of(context).cancel, + // isDestructive: true, + // obscureText: true, + // hintText: '******', + // minLines: 1, + // maxLines: 1, + // ); + // if (input == null) return; + // await showFutureLoadingDialog( + // context: context, + // future: () => Matrix.of(context).client.deactivateAccount( + // auth: AuthenticationPassword( + // password: input, + // identifier: AuthenticationUserIdentifier( + // user: Matrix.of(context).client.userID!, + // ), + // ), + // ), + // ); + // Pangea# + + final resp = await showFutureLoadingDialog( context: context, - title: L10n.of(context).pleaseEnterYourPassword, - okLabel: L10n.of(context).ok, - cancelLabel: L10n.of(context).cancel, - isDestructive: true, - obscureText: true, - hintText: '******', - minLines: 1, - maxLines: 1, - ); - if (input == null) return; - await showFutureLoadingDialog( - context: context, - future: () => Matrix.of(context).client.deactivateAccount( - auth: AuthenticationPassword( - password: input, - identifier: AuthenticationUserIdentifier( - user: Matrix.of(context).client.userID!, + delay: false, + future: () => + Matrix.of(context).client.uiaRequestBackground( + (auth) => Matrix.of(context).client.deactivateAccount( + auth: auth, + ), ), - ), - ), ); + + if (!resp.isError) { + await Matrix.of(context).client.logout(); + } } void showBootstrapDialog(BuildContext context) async {