build
This commit is contained in:
@@ -81,10 +81,12 @@ class AuthController(
|
||||
}
|
||||
|
||||
@PostMapping("/tg-login")
|
||||
fun tgLogin(@RequestBody tgUser: UserDTO.TelegramAuthDTO): String {
|
||||
fun tgLogin(@RequestBody tgUser: UserDTO.TelegramAuthDTO): Map<String, String> {
|
||||
// println(tgUser.hash)
|
||||
// println(botToken)
|
||||
val ok = verifyTelegramAuth(tgUser.toTelegramMap(), botToken)
|
||||
if (!ok) throw IllegalArgumentException("Invalid Telegram login")
|
||||
return authService.tgAuth(tgUser)
|
||||
return mapOf("token" to authService.tgAuth(tgUser))
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user