catto.js 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/TelegramBot.js +1 -1
  2. package/package.json +1 -1
package/TelegramBot.js CHANGED
@@ -117,7 +117,7 @@ module.exports = class extends EventEmitter {
117
117
  var dcs = decodeURIComponent(qs).split("&").sort();
118
118
  var hash = dcs.find(a => a.startsWith("hash=")).split("=")[1];
119
119
  dcs = dcs.filter(a => !a.startsWith("hash=")).join("\n");
120
- var secretKey = crypto.createHmac("sha256", "WebAppData").update("7198222939:AAH3IXLpmxhyRP2A_GOI7LR5UwA0ABLEWnQ").digest();
120
+ var secretKey = crypto.createHmac("sha256", "WebAppData").update(this.options.token).digest();
121
121
  var checkHash = crypto.createHmac("sha256", secretKey).update(dcs).digest("hex");
122
122
  return (checkHash === hash ? new TelegramUser(JSON.parse(dcs.split("\n").find(a => a.startsWith("user=")).split("=")[1]), this) : null);
123
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {