Skip to content

Conversation

coleleavitt
Copy link

This pull request improves error handling for App Store login, specifically around two-factor authentication (2FA) codes. It introduces a new error for invalid or expired 2FA codes, enhances the logic for parsing login responses, and adds comprehensive test coverage for these scenarios.

Error handling improvements:

  • Added a new error ErrInvalidAuthCode to represent invalid or expired 2FA codes in appstore_login.go.
  • Updated the login response parser to return ErrInvalidAuthCode for various failure types and customer messages related to invalid 2FA codes.
  • Included the FailureTypeInvalidAuthCode constant ("5005") to identify invalid auth code errors from the API.
  • Improved generic error reporting by including the failure type in error messages for easier debugging.

Test coverage enhancements:

  • Added new tests to ensure that invalid or expired 2FA codes return the correct error, and that error messages include the failure type when appropriate. [1] [2] [3]

fixing #392 and #387

need to reference @pradeepvizz for suggesting one request a 2FA code on the website and then utilizing that through the auth-code parameter.

@Akimio521
Copy link

hi, could you tell how can I use this tool?
I try to build binary exe file and run

✦3 ❯ ./ipatool auth login -e [email protected] -p xxxxxxxxx  --verbose                 
[4] 18822
zsh: command not found: 8c

ipatool on  fix/invalid-auth-code [?] via 🐹 v1.24.1 
✦4 ❯ 8:05AM INF enter 2FA code:

[4]  + suspended (tty input)  ./ipatool auth login -e [email protected] -p xxxxxxxxx

but the process was already terminated before I had a chance to enter the 2FA code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants