mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 03:14:02 +00:00
fix(review): harden miniapp auth and finance flows
This commit is contained in:
@@ -36,7 +36,11 @@ export function verifyTelegramMiniAppInitData(
|
||||
|
||||
const authDateSeconds = Number(authDateRaw)
|
||||
const nowSeconds = Math.floor(now.getTime() / 1000)
|
||||
if (Math.abs(nowSeconds - authDateSeconds) > maxAgeSeconds) {
|
||||
if (authDateSeconds > nowSeconds) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (nowSeconds - authDateSeconds > maxAgeSeconds) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user