diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 366ad044b3..43f37f4601 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -852,7 +852,7 @@ class OnboardingViewModel @AssistedInject constructor( } withState { - if (it.serverType == ServerType.MatrixOrg) { + if (loginMode.supportsSignModeScreen()) { when (it.onboardingFlow) { OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn)) OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp)) @@ -880,3 +880,13 @@ class OnboardingViewModel @AssistedInject constructor( return authenticationService.getFallbackUrl(forSignIn, deviceId) } } + +private fun LoginMode.supportsSignModeScreen(): Boolean { + return when (this) { + LoginMode.Password, + is LoginMode.SsoAndPassword -> true + is LoginMode.Sso, + LoginMode.Unknown, + LoginMode.Unsupported -> false + } +}