From 2d6cda3c15a044c27aa5a1ba21ec1b4380a23010 Mon Sep 17 00:00:00 2001 From: Jordan Haven Date: Wed, 16 Oct 2024 10:11:49 -0400 Subject: [PATCH] Remove primary authentication factor check, since it's apparently not actually required --- source/sdk/build.gradle | 2 +- .../sdk/ui/robots/StytchAuthenticationAppRobot.kt | 4 ---- .../sdk/ui/tests/StytchAuthenticationAppTest.kt | 13 ------------- .../com/stytch/sdk/ui/StytchAuthenticationApp.kt | 10 ---------- source/sdk/src/main/res/values/strings.xml | 1 - 5 files changed, 1 insertion(+), 29 deletions(-) diff --git a/source/sdk/build.gradle b/source/sdk/build.gradle index 6881a2890..a6cf26985 100644 --- a/source/sdk/build.gradle +++ b/source/sdk/build.gradle @@ -10,7 +10,7 @@ plugins { ext { PUBLISH_GROUP_ID = 'com.stytch.sdk' - PUBLISH_VERSION = '0.29.1' + PUBLISH_VERSION = '0.29.2' PUBLISH_ARTIFACT_ID = 'sdk' } diff --git a/source/sdk/src/androidTest/java/com/stytch/sdk/ui/robots/StytchAuthenticationAppRobot.kt b/source/sdk/src/androidTest/java/com/stytch/sdk/ui/robots/StytchAuthenticationAppRobot.kt index b338eff4b..9b288afb3 100644 --- a/source/sdk/src/androidTest/java/com/stytch/sdk/ui/robots/StytchAuthenticationAppRobot.kt +++ b/source/sdk/src/androidTest/java/com/stytch/sdk/ui/robots/StytchAuthenticationAppRobot.kt @@ -13,8 +13,4 @@ internal class StytchAuthenticationAppRobot( fun isEMLAndOTPError(error: StytchUIInvalidConfiguration) { assert(error.message == getString(R.string.eml_and_otp_error)) } - - fun isMisconfiguredError(error: StytchUIInvalidConfiguration) { - assert(error.message == getString(R.string.misconfigured_products_and_options)) - } } diff --git a/source/sdk/src/androidTest/java/com/stytch/sdk/ui/tests/StytchAuthenticationAppTest.kt b/source/sdk/src/androidTest/java/com/stytch/sdk/ui/tests/StytchAuthenticationAppTest.kt index 51bd759b4..baae80e0b 100644 --- a/source/sdk/src/androidTest/java/com/stytch/sdk/ui/tests/StytchAuthenticationAppTest.kt +++ b/source/sdk/src/androidTest/java/com/stytch/sdk/ui/tests/StytchAuthenticationAppTest.kt @@ -3,7 +3,6 @@ package com.stytch.sdk.ui.tests import com.stytch.sdk.common.errors.StytchUIInvalidConfiguration import com.stytch.sdk.ui.BaseAndroidComposeTest import com.stytch.sdk.ui.data.EML_AND_OTP_ERROR_STYTCH_UI_CONFIG -import com.stytch.sdk.ui.data.NO_PASSWORD_EML_OR_OTP_STYTCH_UI_CONFIG import com.stytch.sdk.ui.robots.stytchAuthenticationAppRobot import org.junit.Test @@ -21,16 +20,4 @@ internal class StytchAuthenticationAppTest : BaseAndroidComposeTest() { isEMLAndOTPError(error!!) } } - - @Test - fun misconfiguredProductsAndOptionsReturnsError() { - stytchAuthenticationAppRobot { - var error: StytchUIInvalidConfiguration? = null - clearAndSetContent(NO_PASSWORD_EML_OR_OTP_STYTCH_UI_CONFIG) { - error = it - } - await() - isMisconfiguredError(error!!) - } - } } diff --git a/source/sdk/src/main/java/com/stytch/sdk/ui/StytchAuthenticationApp.kt b/source/sdk/src/main/java/com/stytch/sdk/ui/StytchAuthenticationApp.kt index c175c4222..2a56db501 100644 --- a/source/sdk/src/main/java/com/stytch/sdk/ui/StytchAuthenticationApp.kt +++ b/source/sdk/src/main/java/com/stytch/sdk/ui/StytchAuthenticationApp.kt @@ -44,16 +44,6 @@ internal fun StytchAuthenticationApp( onInvalidConfig(StytchUIInvalidConfiguration(stringResource(id = R.string.eml_and_otp_error))) return } - if ( - !productConfig.products.contains(StytchProduct.PASSWORDS) && - // no passwords - !productConfig.products.contains(StytchProduct.EMAIL_MAGIC_LINKS) && - // no EML - !productConfig.otpOptions.methods.contains(OTPMethods.EMAIL) // no Email OTP - ) { - onInvalidConfig(StytchUIInvalidConfiguration(stringResource(id = R.string.misconfigured_products_and_options))) - return - } Surface( modifier = modifier.fillMaxSize(), color = Color(LocalStytchTheme.current.backgroundColor), diff --git a/source/sdk/src/main/res/values/strings.xml b/source/sdk/src/main/res/values/strings.xml index 5035b4c7b..960f7269e 100644 --- a/source/sdk/src/main/res/values/strings.xml +++ b/source/sdk/src/main/res/values/strings.xml @@ -53,7 +53,6 @@ Cancel Success! You have successfully logged in. - You must have at least one primary authentication factor (Passwords, EML, or Email OTP) enabled Hide password Show password Great job! This is a strong password.