From b0c44bacde4f80ca96849996f1de10ac274684fd Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Thu, 2 May 2024 21:07:33 +0300 Subject: [PATCH] fix(login): URL encode user email #305 --- .../com/artemchep/keyguard/provider/bitwarden/api/login.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/provider/bitwarden/api/login.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/provider/bitwarden/api/login.kt index 86e73c41..1704cb7d 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/provider/bitwarden/api/login.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/provider/bitwarden/api/login.kt @@ -5,6 +5,7 @@ import com.artemchep.keyguard.common.io.bind import com.artemchep.keyguard.common.model.Argon2Mode import com.artemchep.keyguard.common.service.crypto.CryptoGenerator import com.artemchep.keyguard.common.service.text.Base64Service +import com.artemchep.keyguard.common.service.text.url import com.artemchep.keyguard.common.usecase.DeviceIdUseCase import com.artemchep.keyguard.common.util.int import com.artemchep.keyguard.core.store.bitwarden.BitwardenToken @@ -97,6 +98,7 @@ private suspend fun internalLogin( // which is just a base-64 string of an email. val emailBase64 = base64Service .encodeToString(email) + .let(base64Service::url) header("Auth-Email", emailBase64) val passwordBase64 = base64Service .encodeToString(passwordKey)