mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Remove brackets in auth widget check.
This commit is contained in:
parent
1d700f846e
commit
9474ddfa91
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ def generate_hash(data: dict, token: str) -> str:
|
||||||
secret = hashlib.sha256()
|
secret = hashlib.sha256()
|
||||||
secret.update(token.encode('utf-8'))
|
secret.update(token.encode('utf-8'))
|
||||||
sorted_params = collections.OrderedDict(sorted(data.items()))
|
sorted_params = collections.OrderedDict(sorted(data.items()))
|
||||||
msg = '\n'.join(["{}={}".format(k, v) for k, v in sorted_params.items() if k != 'hash'])
|
msg = '\n'.join("{}={}".format(k, v) for k, v in sorted_params.items() if k != 'hash')
|
||||||
return hmac.new(secret.digest(), msg.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()
|
return hmac.new(secret.digest(), msg.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue