DEBUG
BOT_open_sesam/pipeline/head This commit looks good
Details
BOT_open_sesam/pipeline/head This commit looks good
Details
Пытаемся поймать передаваемый номер в логахtest
parent
93e5303ee6
commit
73c2f1f440
1
auth.py
1
auth.py
|
|
@ -14,6 +14,7 @@ def normalize_phone(phone: str) -> str:
|
||||||
async def authorize_user(user_id: int, phone: str) -> bool:
|
async def authorize_user(user_id: int, phone: str) -> bool:
|
||||||
normalized = normalize_phone(phone)
|
normalized = normalize_phone(phone)
|
||||||
api_url = "https://papi.dataekb.ru/check_access"
|
api_url = "https://papi.dataekb.ru/check_access"
|
||||||
|
print("DEBUG: phone (var normalized) is ", normalized)
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
try:
|
try:
|
||||||
async with session.get(api_url, params={"tel": normalized}) as response:
|
async with session.get(api_url, params={"tel": normalized}) as response:
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ def register_contact_handler(dp: Dispatcher):
|
||||||
|
|
||||||
phone = msg.contact.phone_number
|
phone = msg.contact.phone_number
|
||||||
if not await authorize_user(user_id, phone):
|
if not await authorize_user(user_id, phone):
|
||||||
|
print("DEBUG: phone in contact_handler is ", phone)
|
||||||
await msg.answer("Доступ запрещён, номер не идентифицирован")
|
await msg.answer("Доступ запрещён, номер не идентифицирован")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue