From b36144d20b1424d710c6c52c60745383b267af9a Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sat, 19 Feb 2022 14:44:19 +0100 Subject: [PATCH] chore: Improve reset password UX --- lib/pages/login/login.dart | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index bef7697e..530fccaf 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -179,15 +179,6 @@ class LoginController extends State { ), ); if (response.error != null) return; - final ok = await showOkAlertDialog( - useRootNavigator: false, - context: context, - title: L10n.of(context)!.weSentYouAnEmail, - message: L10n.of(context)!.pleaseClickOnLink, - okLabel: L10n.of(context)!.iHaveClickedOnLink, - fullyCapitalizedForMaterial: false, - ); - if (ok != OkCancelResult.ok) return; final password = await showTextInputDialog( useRootNavigator: false, context: context, @@ -206,8 +197,18 @@ class LoginController extends State { ], ); if (password == null) return; + final ok = await showOkAlertDialog( + useRootNavigator: false, + context: context, + title: L10n.of(context)!.weSentYouAnEmail, + message: L10n.of(context)!.pleaseClickOnLink, + okLabel: L10n.of(context)!.iHaveClickedOnLink, + fullyCapitalizedForMaterial: false, + ); + if (ok != OkCancelResult.ok) return; final data = { 'new_password': password.single, + 'logout_devices': false, "auth": AuthenticationThreePidCreds( type: AuthenticationTypes.emailIdentity, threepidCreds: ThreepidCreds( @@ -227,6 +228,9 @@ class LoginController extends State { if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(L10n.of(context)!.passwordHasBeenChanged))); + usernameController.text = input.single; + passwordController.text = password.single; + login(); } }