From f6f8b1ca3ddd7019a56b088d0e09782d3645d372 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta Date: Fri, 9 Feb 2024 13:41:00 +0530 Subject: [PATCH] Fix inconsitent state (#446) If user clicks on New user login flow, abandon that in between and tries account recovery via recovery code, we were using old volatile password in memory for generating the recovery_key for UI. This PR fixes that issue. --- lib/ui/account/login_page.dart | 39 ++++++++++++++++++---------------- pubspec.yaml | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/ui/account/login_page.dart b/lib/ui/account/login_page.dart index b2cfce745..bfa50b8c2 100644 --- a/lib/ui/account/login_page.dart +++ b/lib/ui/account/login_page.dart @@ -62,6 +62,7 @@ class _LoginPageState extends State { buttonText: context.l10n.logInLabel, onPressedFunction: () async { UserService.instance.setEmail(_email!); + Configuration.instance.resetVolatilePassword(); SrpAttributes? attr; bool isEmailVerificationEnabled = true; try { @@ -176,31 +177,33 @@ class _LoginPageState extends State { .copyWith(fontSize: 12), tags: { 'u-terms': StyledTextActionTag( - (String? text, Map attrs) => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) { - return WebPage( - context.l10n.termsOfServicesTitle, - "https://ente.io/terms", - ); - }, - ), + (String? text, Map attrs) => + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return WebPage( + context.l10n.termsOfServicesTitle, + "https://ente.io/terms", + ); + }, ), + ), style: const TextStyle( decoration: TextDecoration.underline, ), ), 'u-policy': StyledTextActionTag( - (String? text, Map attrs) => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) { - return WebPage( - context.l10n.privacyPolicyTitle, - "https://ente.io/privacy", - ); - }, - ), + (String? text, Map attrs) => + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return WebPage( + context.l10n.privacyPolicyTitle, + "https://ente.io/privacy", + ); + }, ), + ), style: const TextStyle( decoration: TextDecoration.underline, ), diff --git a/pubspec.yaml b/pubspec.yaml index cc7adfee2..c86f1b0b3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ente_auth description: ente two-factor authenticator -version: 2.0.33+233 +version: 2.0.34+234 publish_to: none environment: