Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 8fa60a1

Browse files
authored
Fix handling of SMS OTP whose first digit is 0 (#87)
The cast to int was removing that digit, but it's meaningful. Without this change, it just keeps requesting the same OTP without sending a new one, and never accepting the user input.
1 parent 39a1731 commit 8fa60a1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

n26/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ def _complete_authentication_flow(self, mfa_token: str) -> dict:
452452
mfa_response_data['grant_type'] = "mfa_otp"
453453

454454
hint = click.style("Enter the 6 digit SMS OTP code", fg="yellow")
455-
mfa_response_data['otp'] = click.prompt(hint, type=int)
455+
456+
# type=str because it can have significant leading zeros
457+
mfa_response_data['otp'] = click.prompt(hint, type=str)
456458
else:
457459
mfa_response_data['grant_type'] = "mfa_oob"
458460

0 commit comments

Comments
 (0)