Soft logout: Support soft logout

#2540
This commit is contained in:
manuroe
2019-07-19 14:25:45 +02:00
parent 7994b3f38b
commit 39551563d2
6 changed files with 96 additions and 2 deletions
@@ -54,6 +54,7 @@
@end
@implementation AuthInputsView
@synthesize softLogoutCredentials;
+ (UINib *)nib
{
@@ -487,6 +488,15 @@
}
}
}
// For soft logout, pass the device_id currently used
if (parameters && self.softLogoutCredentials)
{
NSMutableDictionary *parametersWithDeviceId = [parameters mutableCopy];
parametersWithDeviceId[@"device_id"] = self.softLogoutCredentials.deviceId;
parameters = parametersWithDeviceId;
}
}
else if (type == MXKAuthenticationTypeRegister)
{
@@ -725,7 +735,12 @@
{
// Note: this use case was not tested yet.
parameters = @{
@"auth": @{@"session":currentSession.session, @"username": self.userLoginTextField.text, @"password": self.passWordTextField.text, @"type": kMXLoginFlowTypePassword}
@"auth": @{
@"session":currentSession.session,
@"username": self.userLoginTextField.text,
@"password": self.passWordTextField.text,
@"type": kMXLoginFlowTypePassword
}
};
}
else if ([self isFlowSupported:kMXLoginFlowTypeTerms] && ![self isFlowCompleted:kMXLoginFlowTypeTerms])
@@ -936,6 +951,12 @@
return YES;
}
- (void)setSoftLogoutCredentials:(MXCredentials *)credentials
{
softLogoutCredentials = credentials;
self.userLoginTextField.text = softLogoutCredentials.userId;
}
- (BOOL)areAllRequiredFieldsSet
{
// Keep enable the submit button.