From 64cef3429ec695b0e7eb5119a3c294dc3ec8aab3 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 19 Sep 2021 13:08:33 +0200 Subject: [PATCH] fix: Password reset --- lib/pages/login.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/login.dart b/lib/pages/login.dart index 36397d0d..05eb957b 100644 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -174,7 +174,8 @@ class LoginController extends State { ], ); if (input == null) return; - final clientSecret = DateTime.now().millisecondsSinceEpoch.toString(); + final clientSecret = + Matrix.of(context).client.generateUniqueTransactionId(); final response = await showFutureLoadingDialog( context: context, future: () => Matrix.of(context).client.requestTokenToResetPasswordEmail( @@ -216,7 +217,7 @@ class LoginController extends State { type: AuthenticationTypes.emailIdentity, threepidCreds: [ ThreepidCreds( - sid: (response as RequestTokenResponse).sid, + sid: response.result.sid, clientSecret: clientSecret, ), ],