Fix initial authentication attempt with 2FA (#331)

I though that the first attempt would not contain the 2fa code,
but I was wrong. This fixes the authentication when using 2fa enabled
accounts.

closes majd/ipatool#326

Co-authored-by: Majd Alfhaily <majd@alfhaily.me>
This commit is contained in:
MaxandMajd Alfhaily authored and GitHub committed 2025-01-20 00:13:19 +01:00
1 parent f3c9076ff0
commit 21cbd596bc
1 file changed
+1 -6
+1 -6
View File
@@ -73,12 +73,7 @@ func (t *appstore) login(email, password, authCode, guid string) (Account, error
retry := true
for attempt := 1; retry && attempt <= 4; attempt++ {
ac := authCode
if attempt == 1 {
ac = ""
}
request := t.loginRequest(email, password, ac, guid, attempt)
request := t.loginRequest(email, password, authCode, guid, attempt)
request.URL, _ = util.IfEmpty(redirect, request.URL), ""
res, err = t.loginClient.Send(request)