mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 08:12:40 +00:00
Console: Authentication - Registration is not currently supported by the app. Add a button to create account on Matrix.org (Web page).
This commit is contained in:
parent
bfddcddadb
commit
2da29cdb74
2 changed files with 23 additions and 3 deletions
|
@ -1222,7 +1222,7 @@
|
|||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="70b-I3-Cuk" userLabel="retryButton">
|
||||
<rect key="frame" x="128" y="30" width="45" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="45" id="4zv-VS-Uz6"/>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="45" id="4zv-VS-Uz6"/>
|
||||
<constraint firstAttribute="height" constant="30" id="eae-iR-11I"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Retry">
|
||||
|
|
|
@ -279,7 +279,18 @@
|
|||
|
||||
if (!_selectedFlow) {
|
||||
// Notify user that no flow is supported
|
||||
_noFlowLabel.text = [NSString stringWithFormat:@"Currently we do not support %@ flows defined by this Home Server", _authType == AuthenticationTypeLogin ? @"Login" : @"Registration"];
|
||||
if (_authType == AuthenticationTypeLogin) {
|
||||
_noFlowLabel.text = @"Currently we do not support Login flows defined by this Home Server.";
|
||||
|
||||
[_retryButton setTitle:@"Retry" forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:@"Retry" forState:UIControlStateHighlighted];
|
||||
} else {
|
||||
_noFlowLabel.text = @"Registration is not currently supported.";
|
||||
|
||||
[_retryButton setTitle:@"Create account on Matrix.org" forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:@"Create account on Matrix.org" forState:UIControlStateHighlighted];
|
||||
}
|
||||
|
||||
_noFlowLabel.hidden = NO;
|
||||
_retryButton.hidden = NO;
|
||||
}
|
||||
|
@ -312,6 +323,8 @@
|
|||
if (!_noFlowLabel.text.length) {
|
||||
_noFlowLabel.text = @"We failed to retrieve authentication flow from this Home Server";
|
||||
}
|
||||
[_retryButton setTitle:@"Retry" forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:@"Retry" forState:UIControlStateHighlighted];
|
||||
_retryButton.hidden = NO;
|
||||
|
||||
// Handle specific error code here
|
||||
|
@ -390,7 +403,14 @@
|
|||
self.authType = AuthenticationTypeLogin;
|
||||
}
|
||||
} else if (sender == _retryButton) {
|
||||
if ([_retryButton.titleLabel.text isEqualToString:@"Retry"]) {
|
||||
[self refreshSupportedAuthFlow];
|
||||
} else {
|
||||
// Open Matrix web page to create an account
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://matrix.org/beta/#/register"]];
|
||||
// Switch back on login screen
|
||||
self.authType = AuthenticationTypeLogin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue