From 6c0825f512e1fce0b91b74279c2f0039543d6c91 Mon Sep 17 00:00:00 2001 From: sergeych Date: Thu, 19 Jan 2023 11:42:12 +0100 Subject: [PATCH] v0.2.1, minor fixes --- build.gradle.kts | 3 +++ kotlin-js-store/yarn.lock | 8 ++++---- .../kotlin/net.sergeych.superlogin/client/Registration.kt | 1 - .../net.sergeych.superlogin/client/SuperloginClient.kt | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7befeec..c28f231 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,6 +45,9 @@ kotlin { } } sourceSets { + all { + languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi") + } val commonMain by getting { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3") diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index dd18620..8baee8a 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -718,10 +718,10 @@ typescript@3.9.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== -unicrypto@1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/unicrypto/-/unicrypto-1.14.0.tgz#eee5f2d88d33bb6ba774c8395edf3f4e2a4a68dc" - integrity sha512-NNaMM2Has6Dzk0OAxhR/OfocTKPgA4TbseKqXZ2A7Kb1gcBRN+He7wuxO6QdDOP7tE5SuXVf9C8R9xeswi/0MQ== +unicrypto@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/unicrypto/-/unicrypto-1.14.1.tgz#da950ff59cb08b992d9c2eec574d385756901e7b" + integrity sha512-5hS1hDQ6QYIysEyTYuy73C3c5h8kmPTkBp4mJ3nPrI5tv7VZOIMWb0heUTc/EQ2x0VAq7WmhKEwXNKl6pOIBsg== dependencies: buffer "^5.4.2" diffie-hellman "^5.0.3" diff --git a/src/commonMain/kotlin/net.sergeych.superlogin/client/Registration.kt b/src/commonMain/kotlin/net.sergeych.superlogin/client/Registration.kt index 4027325..452f865 100644 --- a/src/commonMain/kotlin/net.sergeych.superlogin/client/Registration.kt +++ b/src/commonMain/kotlin/net.sergeych.superlogin/client/Registration.kt @@ -65,7 +65,6 @@ class Registration( inline suspend fun register( login: String, password: String, - derivationParams: PasswordDerivationParams = PasswordDerivationParams(rounds = pbkdfRounds), extraData: T? = null, ): Result = registerWithData(login, password, extraData?.let { BossEncoder.encode(it) }) diff --git a/src/commonMain/kotlin/net.sergeych.superlogin/client/SuperloginClient.kt b/src/commonMain/kotlin/net.sergeych.superlogin/client/SuperloginClient.kt index b92e725..61161c2 100644 --- a/src/commonMain/kotlin/net.sergeych.superlogin/client/SuperloginClient.kt +++ b/src/commonMain/kotlin/net.sergeych.superlogin/client/SuperloginClient.kt @@ -79,6 +79,7 @@ class SuperloginClient( } } + @Suppress("UNCHECKED_CAST") val applicationData: D? get() = (state.value as? LoginState.LoggedIn)?.loginData?.data @@ -356,7 +357,7 @@ class SuperloginClient( val (id, key) = RestoreKey.parse(secret) val packedACO = invoke(serverApi.slRequestACOBySecretId, id) AccessControlObject.unpackWithKey(packedACO, key)?.let { - changePasswordWithACO(it, newPassword) + changePasswordWithACO(it, newPassword, params, loginKeyStrength) clientState } } catch (x: RestoreKey.InvalidSecretException) {