Skip to content

Commit

Permalink
Merge pull request #220 from stytchauth/jordan/SDK-2121-sms-oauth-val…
Browse files Browse the repository at this point in the history
…id-primary

SDK-2121 Remove primary authentication factor check
  • Loading branch information
jhaven-stytch authored Oct 16, 2024
2 parents 8652609 + 2d6cda3 commit 4aa3cdf
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion source/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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!!)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion source/sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<string name="cancel">Cancel</string>
<string name="success">Success!</string>
<string name="logged_in">You have successfully logged in.</string>
<string name="misconfigured_products_and_options">You must have at least one primary authentication factor (Passwords, EML, or Email OTP) enabled</string>
<string name="hide_password">Hide password</string>
<string name="show_password">Show password</string>
<string name="strong_password">Great job! This is a strong password.</string>
Expand Down

0 comments on commit 4aa3cdf

Please sign in to comment.