diff --git a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m index 5add8bef27..1eb9b5d668 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m @@ -899,18 +899,21 @@ - (void)setSoftLogoutCredentials:(MXCredentials *)softLogoutCredentials // 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 0000000000..745f117baa --- /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.