fix: use UIARequest for account deletion to enable deletion of SSO accounts
This commit is contained in:
parent
8d76559e93
commit
7eaefaba49
1 changed files with 38 additions and 21 deletions
|
|
@ -102,30 +102,47 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
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<IdServerUnbindResult?>(
|
||||
(auth) => Matrix.of(context).client.deactivateAccount(
|
||||
auth: auth,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (!resp.isError) {
|
||||
await Matrix.of(context).client.logout();
|
||||
}
|
||||
}
|
||||
|
||||
void showBootstrapDialog(BuildContext context) async {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue