Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
MXKAuthenticationViewController: Do not present fallback when there i…
Browse files Browse the repository at this point in the history
…s one unsupported login flows among supported ones.
  • Loading branch information
SBiOSoftWhare committed Oct 1, 2020
1 parent b2fb48d commit 1638b54
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions MatrixKit/Controllers/MXKAuthenticationViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,18 @@ - (void)handleAuthenticationSession:(MXAuthenticationSession *)authSession
NSLog(@"[MXKAuthenticationVC] Received authentication settings are not supported");
authInputsView = nil;
}
// Check whether all listed flows in this authentication session are supported
// We suggest using the fallback page (if any), when at least one flow is not supported.
else if ((authInputsView.authSession.flows.count != authSession.flows.count)
&& authenticationFallback.length
&& !_softLogoutCredentials)
else if (!_softLogoutCredentials)
{
NSLog(@"[MXKAuthenticationVC] Suggest using fallback page");
authInputsView = nil;
// If all listed flows in this authentication session are not supported we suggest using the fallback page.
if (authenticationFallback.length && authInputsView.authSession.flows.count == 0)
{
NSLog(@"[MXKAuthenticationVC] No supported flow, suggest using fallback page");
authInputsView = nil;
}
else if (authInputsView.authSession.flows.count != authSession.flows.count)
{
NSLog(@"[MXKAuthenticationVC] The authentication session contains at least one unsupported flow");
}
}
}

Expand Down

0 comments on commit 1638b54

Please sign in to comment.