diff options
author | Vitaly Takmazov | 2023-01-14 08:20:59 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-14 08:20:59 +0300 |
commit | 63ead138664a6477460884d266d4f93011ec134a (patch) | |
tree | b194f14ba559e4e06e8bee5686dd0fd9506bbac9 /src/main/java/com/juick/www | |
parent | 3e24323834b324aac0deb228c7a66be570c5fbb9 (diff) |
Minor updates for Telegram Login and bot
Diffstat (limited to 'src/main/java/com/juick/www')
-rw-r--r-- | src/main/java/com/juick/www/controllers/SocialLogin.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/controllers/SocialLogin.java b/src/main/java/com/juick/www/controllers/SocialLogin.java index b43b65c6..1ab0a139 100644 --- a/src/main/java/com/juick/www/controllers/SocialLogin.java +++ b/src/main/java/com/juick/www/controllers/SocialLogin.java @@ -299,12 +299,12 @@ public class SocialLogin { @GetMapping("/_tglogin") public String doDurovLogin(@RequestParam Map<String, String> params, + @RequestParam String hash, @RequestHeader(value = "referer", required = false) String referer, HttpServletRequest request, HttpServletResponse response) { String dataCheckString = params.entrySet().stream().filter(p -> !p.getKey().equals("hash")) .sorted(Map.Entry.comparingByKey()).map(p -> p.getKey() + "=" + p.getValue()) .collect(Collectors.joining("\n")); - String hash = params.get("hash"); byte[] secretKey = DigestUtils.sha256(telegramToken); String resultString = new HmacUtils(HmacAlgorithms.HMAC_SHA_256, secretKey).hmacHex(dataCheckString); if (hash.equals(resultString)) { |