diff --git a/backend/src/main/kotlin/ru/posidata/backend/service/TelegramAuthService.kt b/backend/src/main/kotlin/ru/posidata/backend/service/TelegramAuthService.kt index 7e4b233..072231f 100644 --- a/backend/src/main/kotlin/ru/posidata/backend/service/TelegramAuthService.kt +++ b/backend/src/main/kotlin/ru/posidata/backend/service/TelegramAuthService.kt @@ -11,7 +11,7 @@ class TelegramAuthService( @Value("\${telegram.bot.token}") private val telegramToken: String, ) { fun isValidHash(parsedData: Map, hash: String): Boolean { - val dataKeys = parsedData.keys.filter { it != "hash" }.sorted() + val dataKeys = parsedData.keys.filter { it != "hash" }.filter { parsedData[it] != "undefined" }.sorted() val items = dataKeys.map { key -> "$key=${parsedData[key]}" } val dataCheckString = items.joinToString("\n") diff --git a/frontend/src/jsMain/kotlin/ru/posidata/views/main/QuestionCard.kt b/frontend/src/jsMain/kotlin/ru/posidata/views/main/QuestionCard.kt index 69e77f1..3b432c2 100644 --- a/frontend/src/jsMain/kotlin/ru/posidata/views/main/QuestionCard.kt +++ b/frontend/src/jsMain/kotlin/ru/posidata/views/main/QuestionCard.kt @@ -52,7 +52,7 @@ val questionCard = FC { props -> when { response.ok -> props.setUser(response.decodeFromJsonString()) - else -> window.alert("Failed to login with telegram") + else -> window.alert("Failed to validate with telegram") } } } diff --git a/frontend/src/jsMain/kotlin/ru/posidata/views/main/ResultCard.kt b/frontend/src/jsMain/kotlin/ru/posidata/views/main/ResultCard.kt index a8b5f7d..618df6c 100644 --- a/frontend/src/jsMain/kotlin/ru/posidata/views/main/ResultCard.kt +++ b/frontend/src/jsMain/kotlin/ru/posidata/views/main/ResultCard.kt @@ -49,7 +49,7 @@ val resultCard = FC { props -> when { response.ok -> props.setUser(response.decodeFromJsonString()) - else -> window.alert("Failed to login with telegram") + else -> window.alert("Failed to validate with telegram") } } } diff --git a/frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt b/frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt index 6d4a765..a67224a 100644 --- a/frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt +++ b/frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt @@ -39,13 +39,14 @@ val welcomeCard = FC { props -> response.ok -> { props.setUser(response.decodeFromJsonString()) } - else -> window.alert("Failed to login with telegram") + else -> window.alert("Failed to validate with telegram") } } props.setSelection(Selection.QUESTION) } // just a small test +/* div { button { onClick = { @@ -71,6 +72,7 @@ val welcomeCard = FC { props -> } } } +*/ div {