Refactor aiogram/utils/auth_widget.py

+ fix check auth widget token in BaseBot, fix tests
This commit is contained in:
Suren Khorenyan 2019-08-16 22:33:19 +03:00
parent 9b2971a525
commit 7863f052d9
6 changed files with 103 additions and 46 deletions

View file

@ -13,7 +13,7 @@ from aiohttp.helpers import sentinel
from . import api
from ..types import ParseMode, base
from ..utils import json
from ..utils.auth_widget import check_token
from ..utils.auth_widget import check_integrity
class BaseBot:
@ -266,4 +266,4 @@ class BaseBot:
self.parse_mode = None
def check_auth_widget(self, data):
return check_token(data, self.__token)
return check_integrity(self.__token, data)