BF: Registration: email or phone number is no more skippable

#2140

Note: There is no more conditions linked to kMXLoginFlowTypeRecaptcha in the code, which makes it look more flexible.
This commit is contained in:
manuroe
2018-12-27 11:56:00 +01:00
parent 8174a4c925
commit 10c5575280
2 changed files with 12 additions and 14 deletions
@@ -965,21 +965,10 @@
// Check whether an account may be created without third-party identifiers.
for (MXLoginFlow *loginFlow in currentSession.flows)
{
if ([loginFlow.stages indexOfObject:kMXLoginFlowTypeDummy] != NSNotFound || [loginFlow.type isEqualToString:kMXLoginFlowTypeDummy])
if ([loginFlow.stages indexOfObject:kMXLoginFlowTypeEmailIdentity] == NSNotFound
&& [loginFlow.stages indexOfObject:kMXLoginFlowTypeEmailCode] == NSNotFound)
{
// The dummy flow is supported, the 3pid are then optional.
return NO;
}
if ((loginFlow.stages.count == 1 && [loginFlow.stages[0] isEqualToString:kMXLoginFlowTypeRecaptcha]) || [loginFlow.type isEqualToString:kMXLoginFlowTypeRecaptcha])
{
// The recaptcha flow is supported alone, the 3pids are then optional.
return NO;
}
if ((loginFlow.stages.count == 1 && [loginFlow.stages[0] isEqualToString:kMXLoginFlowTypePassword]) || [loginFlow.type isEqualToString:kMXLoginFlowTypePassword])
{
// The password flow is supported alone, the 3pids are then optional.
// There is a flow with no 3pids
return NO;
}
}