From a6eaf9178e1d9070b09c2c708c2409ff08ebd450 Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Thu, 28 Nov 2024 16:01:54 +0200 Subject: [PATCH] fix: Detect OTP protocols case-insensitively #723 --- .../kotlin/com/artemchep/keyguard/common/model/TotpToken.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/model/TotpToken.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/model/TotpToken.kt index 2788bacd..6fc071fd 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/model/TotpToken.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/model/TotpToken.kt @@ -17,9 +17,9 @@ sealed interface TotpToken { url: String, ): Either = catch { when { - url.startsWith(PREFIX_OTP_AUTH) -> parseOtpAuth(url) - url.startsWith(PREFIX_OTP_STEAM) -> parseOtpSteam(url) - url.startsWith(PREFIX_OTP_MOBILE) -> parseOtpMobile(url) + url.startsWith(PREFIX_OTP_AUTH, ignoreCase = true) -> parseOtpAuth(url) + url.startsWith(PREFIX_OTP_STEAM, ignoreCase = true) -> parseOtpSteam(url) + url.startsWith(PREFIX_OTP_MOBILE, ignoreCase = true) -> parseOtpMobile(url) else -> { // By default we think that the url is a key and the token // type is otp-auth.