mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Authentication: support SSO by using the fallback URL
#2306 Disable register button on SSO
This commit is contained in:
parent
6b2377b763
commit
6015555e30
1 changed files with 20 additions and 3 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue