chemelli74 / aioamazondevices

Python library to control Amazon devices
Apache License 2.0
12 stars 2 forks source link

OTP Code (SMS) will be sent too late #23

Open ChristophCaina opened 1 month ago

ChristophCaina commented 1 month ago

Describe the bug it seems that the OTP request is too early... when having the OTP via SMS, I will only receive the OTP after trying to login - where the OTP already had to be submitted.

To Reproduce Test-Case

  1. execute the following command: amazon_test.py --country DE --email c******@c***** --password *******

  2. The script will ask for the OTP (should be received via SMS) --> no SMS will be received.

after providing "something" to the script is throwing "cannot authenticate....." And THEN I do receive the OTP SMS.

Additional context Add any other context about the problem here.

ChristophCaina commented 1 month ago

it is just the same case as described by "code-in-progress" in the Forum thread :) The SMS will be received just immediately after trying to login with a false OTP code.

Confirmed after 3 different times. Testcase 2 was trying the OTP Code that was sent earlier, the reply was an already closed session. After submitting this, the new OTP Code was received.

chemelli74 commented 1 month ago

Thx for testing.

TBH, I though that nowadays nobody would use SMS anymore and didn't test myself.

Is just as simple as moving the OTP request at a later stage in the script.

ChristophCaina commented 1 month ago

Maybe, since this could be an exception, Just ask for the otp method and select the correct Workflow accordingly?

chemelli74 commented 1 month ago

No need actually to make 2 flows.

The rule of the library is "keep it as simple as possible".

ChristophCaina commented 1 month ago

so, I went through the console output of the script again, and I can confirm, that it does pull the devices at least... I don't really know how, because the OTP will be generated and sent AFTER the session will be closed...