Commit b495f58e authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

check auth date

parent 1551ed74
...@@ -32,9 +32,9 @@ func VerifyInitData(initData, botToken string) (ok bool, userId string) { ...@@ -32,9 +32,9 @@ func VerifyInitData(initData, botToken string) (ok bool, userId string) {
if key == "auth_date" { if key == "auth_date" {
authDate, _ := strconv.Atoi(params.Get(key)) authDate, _ := strconv.Atoi(params.Get(key))
if int64(authDate) < time.Now().Unix()-1800 { if int64(authDate) < time.Now().Unix()-3600 || int64(authDate) > time.Now().Unix()+300 {
// todo 可以限制超时时间 // todo 可以限制超时时间
// return false return false, ""
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment