diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolver.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolver.kt index cc64977617c..c824a526f02 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolver.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolver.kt @@ -14,7 +14,7 @@ class WebViewAuthenticationFlowResolver @Inject constructor( ) { // A list of domains that we know that wordpress.com supports redirecting to private val wpComAuthAcceptedDomains - get() = listOf("wordpress.com", "wp.com", "jetpack.com", "woocommerce.com") + get() = listOf("wordpress.com", "wp.com", "jetpack.com", "jetpack.wordpress.com", "woocommerce.com") fun resolve(url: String): WebViewAuthenticationFlow { val currentSite = selectedSite.getOrNull() @@ -24,8 +24,7 @@ class WebViewAuthenticationFlowResolver @Inject constructor( return if (isWPComAuthenticated) { when { - wpComAuthAcceptedDomains.any { it == urlDomain } || - (currentSite?.isWPComAtomic == true && url.isPartOf(currentSite)) -> { + wpComAuthAcceptedDomains.any { it == urlDomain } -> { WebViewAuthenticationFlow.WPCom } diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolverTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolverTest.kt index eab91b3df93..f792e297de5 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolverTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/common/webview/WebViewAuthenticationFlowResolverTest.kt @@ -48,20 +48,6 @@ class WebViewAuthenticationFlowResolverTest { assertThat(result).isEqualTo(WebViewAuthenticationFlowResolver.WebViewAuthenticationFlow.WPCom) } - @Test - fun `given WPCom authenticated and an atomic site, when resolving the authentication flow, then it should return WPCom`() { - givenWPComAuthenticated() - givenSite { - setIsWPComAtomic(true) - url = "https://example.com" - } - val url = "https://example.com/test" - - val result = sut.resolve(url) - - assertThat(result).isEqualTo(WebViewAuthenticationFlowResolver.WebViewAuthenticationFlow.WPCom) - } - @Test fun `given WPCom authenticated and a Jetpack SSO site, when resolving the authentication flow, then it should return JetpackSSO`() { givenWPComAuthenticated()