24 lines
618 B
Python
24 lines
618 B
Python
ALLOWED_PHONE_NUMBERS = [
|
||
"+79000959392",
|
||
]
|
||
|
||
AUTHORIZED_USERS = {}
|
||
|
||
|
||
def check_user_auth(phone: str) -> bool:
|
||
return phone in ALLOWED_PHONE_NUMBERS
|
||
|
||
|
||
def authorize_user(user_id: int, phone: str) -> bool:
|
||
if check_user_auth(phone):
|
||
AUTHORIZED_USERS[user_id] = phone
|
||
print(f"{user_id} авторизован с номером: {phone}")
|
||
return True
|
||
else:
|
||
print(f"Пользователь {user_id} пытался авторизоваться с номером {phone}")
|
||
return False
|
||
|
||
|
||
def is_user_auth(user_id: int) -> bool:
|
||
return user_id in AUTHORIZED_USERS
|