diff --git a/src/commonMain/kotlin/com/liftric/cognito/idp/core/Payload.kt b/src/commonMain/kotlin/com/liftric/cognito/idp/core/Payload.kt index f5be0ae..f25c3cf 100644 --- a/src/commonMain/kotlin/com/liftric/cognito/idp/core/Payload.kt +++ b/src/commonMain/kotlin/com/liftric/cognito/idp/core/Payload.kt @@ -4,6 +4,7 @@ package com.liftric.cognito.idp.core import kotlinx.serialization.Serializable +import kotlin.js.JsExport @Serializable internal data class SignIn( @@ -130,6 +131,7 @@ internal data class SetUserMFAPreference( val SoftwareTokenMfaSettings: MfaSettings? ) +@JsExport @Serializable data class MfaSettings( val Enabled: Boolean, diff --git a/src/commonMain/kotlin/com/liftric/cognito/idp/core/Response.kt b/src/commonMain/kotlin/com/liftric/cognito/idp/core/Response.kt index 18325ce..dc17e78 100644 --- a/src/commonMain/kotlin/com/liftric/cognito/idp/core/Response.kt +++ b/src/commonMain/kotlin/com/liftric/cognito/idp/core/Response.kt @@ -5,6 +5,8 @@ package com.liftric.cognito.idp.core import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +import kotlin.js.JsExport + @Serializable data class RequestError( @SerialName("__type") @@ -85,12 +87,14 @@ data class ForgotPasswordResponse( val CodeDeliveryDetails: CodeDeliveryDetails ) +@JsExport @Serializable data class AssociateSoftwareTokenResponse( val SecretCode: String, val Session: String? = null ) +@JsExport @Serializable data class VerifySoftwareTokenResponse( val Session: String? = null, diff --git a/src/jsMain/kotlin/IdentityProviderJS.kt b/src/jsMain/kotlin/IdentityProviderJS.kt index 297aafe..1e057ba 100644 --- a/src/jsMain/kotlin/IdentityProviderJS.kt +++ b/src/jsMain/kotlin/IdentityProviderJS.kt @@ -148,12 +148,12 @@ class IdentityProviderClientJS(region: String, clientId: String) { fun respondToAuthChallenge( challengeName: String, - challengeResponses: Map, + challengeResponses: Array, session: String ): Promise = MainScope().promise { provider.respondToAuthChallenge( challengeName, - challengeResponses, + challengeResponses.associate { it.key to it.value }, session ).getOrThrow().let { SignInResponseJS( @@ -196,4 +196,3 @@ private fun AuthenticationResult.toJs(): AuthenticationResultJS = private fun CodeDeliveryDetails.toJs(): CodeDeliveryDetailsJS = CodeDeliveryDetailsJS(AttributeName = AttributeName, DeliveryMedium = DeliveryMedium, Destination = Destination) -