[BUG]: Allow the usage of non-interactive authentication
Description I need to use a different interface for entering authentication code sent via SMS, because the library is being used on a server.
Steps for reproducing
- Install the library
$ python -m asyncio
>>> import pymax
>>> c = pymax.MaxClient('+74951234567')
...
>>> await c.start()
...
Введите код:
- See the prompt asking for the confirmation code
Expected result
send_codeandsign_in(or equivalent) functions to be available, just like in Pyrogram. The second function should take a code as an argument.
Actual result The library is acting wrong by asking for the code itself, while it doesn't have to do it.
Additional information Python version is: 3.13.7
you can use custom login flow
async def login_flow_test():
await client.connect()
temp_token = await client.request_code(phone)
code = input("Code: ").strip()
await client.login_with_code(temp_token, code, start=False)
(added at version 1.1.19)
If the issue is resolved, please close it.
you can use custom login flow
async def login_flow_test(): await client.connect() temp_token = await client.request_code(phone) code = input("Code: ").strip() await client.login_with_code(temp_token, code, start=False)
(added at version
1.1.19)
Sorry, I didn't know that. Thanks for the example!
@ink-developer Is this available at v2.x?