Skip to content

Commit

Permalink
Just a test commit for investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Sep 8, 2024
1 parent bf62d7d commit 93c9158
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class UserController(
) {
@GetMapping("/get")
fun getResults(
@RequestParam authDate: Int,
@RequestParam authDate: Long,
@RequestParam firstName: String,
@RequestParam lastName: String,
@RequestParam hash: String,
@RequestParam id: Int,
@RequestParam id: Long,
@RequestParam photoUrl: String,
@RequestParam username: String,
): ResponseEntity<Any> {
Expand All @@ -38,6 +38,7 @@ class UserController(
println("Received a request to get results from $user. Converted to map: ${user.convertToMap()}")

if(!telegramAuthService.isValidHash(user.convertToMap(), user.hash)) {
println("Validation unsuccessful for ${user.username}")
return ResponseEntity(HttpStatus.FORBIDDEN)
}

Expand All @@ -49,11 +50,11 @@ class UserController(

@GetMapping("/update")
fun submitAnswer(
@RequestParam authDate: Int,
@RequestParam authDate: Long,
@RequestParam firstName: String,
@RequestParam lastName: String,
@RequestParam hash: String,
@RequestParam id: Int,
@RequestParam id: Long,
@RequestParam photoUrl: String,
@RequestParam username: String,
@RequestParam isNextRound: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import kotlinx.serialization.Serializable

@Serializable
data class UserDataFromTelegram (
val authDate: Int,
val authDate: Long,
val firstName: String,
val lastName: String,
val hash: String,
val id: Int,
val id: Long,
val photoUrl: String,
val username: String,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
photoUrl = user.photo_url,
username = user.username,
)
console.log(feUser.convertToMap())
props.setTgUser(feUser)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ package ru.posidata.views.utils.externals.telegram

@JsName("TUser")
external interface TUser {
var auth_date: Int
var auth_date: Long
var first_name: String
var last_name: String
var hash: String
var id: Int
var id: Long
var photo_url: String
var username: String
}

0 comments on commit 93c9158

Please sign in to comment.