Skip to content

Commit

Permalink
print tg auth_date
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanmomo committed May 23, 2024
1 parent 7ab23ef commit 2fcd68a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public static boolean verifyTelegramParameter(Map<String, String> params, String
try {
long authDate = Long.parseLong(params.get("auth_date"));
long now = Instant.now().getEpochSecond();
if (authDate >= now || (now - authDate) > AUTH_DATE_RANGE_MINUTE * 60) {
log.error("The auth date of telegram request is before {} minutes ago.", AUTH_DATE_RANGE_MINUTE);
if (Math.abs(now - authDate) > AUTH_DATE_RANGE_MINUTE * 60) {
log.error("The auth date {} of telegram request is before {} minutes ago compare to now {}.", authDate,
AUTH_DATE_RANGE_MINUTE, now);
return false;
}
SecretKeySpec sk = new SecretKeySpec(
Expand Down

0 comments on commit 2fcd68a

Please sign in to comment.