Show fallback on authentication coordinator

This commit is contained in:
ismailgulek
2022-05-27 17:49:54 +03:00
parent 43468ce5ea
commit 61baafc56f
3 changed files with 102 additions and 24 deletions
@@ -66,5 +66,24 @@ struct AuthenticationState {
showRegistrationForm: registrationFlow != nil,
ssoIdentityProviders: preferredLoginMode.ssoIdentityProviders ?? [])
}
/// Needs authentication fallback for login or registration
var needsFallback: Bool {
switch preferredLoginMode {
case .unsupported:
return true
default:
break
}
guard let flow = registrationFlow else {
return false
}
switch flow {
case .flowResponse(let result):
return result.needsFallback
default:
return false
}
}
}
}