From cbd0c7478c02afbda2b6af44bc88e5d5e0ab1f44 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 13 Jul 2022 09:41:30 +0100 Subject: [PATCH] Fix a bug setting nil soft logout credentials. --- .../MXKAuthenticationViewController.m | 21 +++++++++++-------- changelog.d/pr-6417.bugfix | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 changelog.d/pr-6417.bugfix diff --git a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m index 5add8bef2..1eb9b5d66 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m @@ -899,18 +899,21 @@ // This is required before updating view's textfields (homeserver url...) [self loadViewIfNeeded]; - // Force register mode - self.authType = MXKAuthenticationTypeLogin; + if (softLogoutCredentials) + { + // Force register mode + self.authType = MXKAuthenticationTypeLogin; - [self setHomeServerTextFieldText:softLogoutCredentials.homeServer]; - [self setIdentityServerTextFieldText:softLogoutCredentials.identityServer]; + [self setHomeServerTextFieldText:softLogoutCredentials.homeServer]; + [self setIdentityServerTextFieldText:softLogoutCredentials.identityServer]; - // Cancel potential request in progress - [mxCurrentOperation cancel]; - mxCurrentOperation = nil; + // Cancel potential request in progress + [mxCurrentOperation cancel]; + mxCurrentOperation = nil; - // Remove the current auth inputs view - self.authInputsView = nil; + // Remove the current auth inputs view + self.authInputsView = nil; + } // Set parameters and trigger a refresh (the parameters will be taken into account during [handleAuthenticationSession:]) _softLogoutCredentials = softLogoutCredentials; diff --git a/changelog.d/pr-6417.bugfix b/changelog.d/pr-6417.bugfix new file mode 100644 index 000000000..745f117ba --- /dev/null +++ b/changelog.d/pr-6417.bugfix @@ -0,0 +1 @@ +Fix a bug where the login screen is shown after choosing to create an account.