Authentication: support SSO by using the fallback URL

#2306

Disable register button on SSO
This commit is contained in:
manuroe 2019-03-04 17:25:21 +01:00
parent 6b2377b763
commit 6015555e30

View file

@ -325,6 +325,9 @@
{
super.userInteractionEnabled = userInteractionEnabled;
// Reset
self.rightBarButtonItem.enabled = YES;
// Show/Hide server options
if (_optionsContainer.hidden == userInteractionEnabled)
{
@ -344,19 +347,33 @@
}
else
{
AuthInputsView *authInputsview;
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
{
authInputsview = (AuthInputsView*)self.authInputsView;
}
// The right bar button is used to switch the authentication type.
if (self.authType == MXKAuthenticationTypeLogin)
{
if (!authInputsview.isSingleSignOnRequired)
{
self.rightBarButtonItem.title = NSLocalizedStringFromTable(@"auth_register", @"Vector", nil);
}
else
{
// Disable register on SSO
self.rightBarButtonItem.enabled = NO;
self.rightBarButtonItem.title = nil;
}
}
else if (self.authType == MXKAuthenticationTypeRegister)
{
self.rightBarButtonItem.title = NSLocalizedStringFromTable(@"auth_login", @"Vector", nil);
// Restore the back button
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
if (authInputsview)
{
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
[self updateRegistrationScreenWithThirdPartyIdentifiersHidden:authInputsview.thirdPartyIdentifiersHidden];
}
}