diff --git a/Vector/Views/Authentication/AuthInputsView.m b/Vector/Views/Authentication/AuthInputsView.m index 8ca5791508..c0eca6ac61 100644 --- a/Vector/Views/Authentication/AuthInputsView.m +++ b/Vector/Views/Authentication/AuthInputsView.m @@ -427,14 +427,22 @@ - (void)prepareParameters:(void (^)(NSDictionary *parameters))callback // Async response return; } - else if (self.isPasswordBasedFlowSupported) + else if (self.isDummyFlowSupported) { parameters = @{ + @"auth": @{@"session":currentSession.session, @"type": kMXLoginFlowTypeDummy}, @"username": self.userLoginTextField.text, @"password": self.passWordTextField.text, @"bind_email": @(NO) }; } + else if (self.isPasswordBasedFlowSupported) + { + // Note: this use case was not tested yet. + parameters = @{ + @"auth": @{@"session":currentSession.session, @"username": self.userLoginTextField.text, @"password": self.passWordTextField.text, @"type": kMXLoginFlowTypePassword} + }; + } } } @@ -729,6 +737,10 @@ - (BOOL)isSupportedFlowType:(MXLoginFlowType)flowType { return YES; } + else if ([flowType isEqualToString:kMXLoginFlowTypeDummy]) + { + return YES; + } return NO; } @@ -900,4 +912,20 @@ - (BOOL)isRecaptchaFlowRequired return NO; } +- (BOOL)isDummyFlowSupported +{ + if (currentSession) + { + for (MXLoginFlow *loginFlow in currentSession.flows) + { + if ([loginFlow.stages indexOfObject:kMXLoginFlowTypeDummy] != NSNotFound || [loginFlow.type isEqualToString:kMXLoginFlowTypeDummy]) + { + return YES; + } + } + } + + return NO; +} + @end