PyMax icon indicating copy to clipboard operation
PyMax copied to clipboard

[BUG]: Allow the usage of non-interactive authentication

Open lotigara opened this issue 1 year ago • 4 comments

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

  1. Install the library
$ python -m asyncio
>>> import pymax
>>> c = pymax.MaxClient('+74951234567')
...
>>> await c.start()
...
Введите код: 
  1. See the prompt asking for the confirmation code Expected result send_code and sign_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

lotigara avatar Dec 01 '25 21:12 lotigara

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)

ink-developer avatar Dec 02 '25 14:12 ink-developer

If the issue is resolved, please close it.

ink-developer avatar Dec 02 '25 14:12 ink-developer

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!

lotigara avatar Dec 02 '25 18:12 lotigara

@ink-developer Is this available at v2.x?

lotigara avatar Jul 18 '26 12:07 lotigara