From 667550b9790716d87e0908123a2e2e88f8ea89ed Mon Sep 17 00:00:00 2001 From: tux-mind <1824153+tux-mind@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:58:38 +0100 Subject: [PATCH] fix login with 2fa 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 --- pkg/appstore/appstore_login.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/appstore/appstore_login.go b/pkg/appstore/appstore_login.go index 642301fc..d8cf57c1 100644 --- a/pkg/appstore/appstore_login.go +++ b/pkg/appstore/appstore_login.go @@ -68,11 +68,7 @@ func (t *appstore) login(email, password, authCode, guid string) (Account, error var res http.Result[loginResult] 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, redirect = util.IfEmpty(redirect, request.URL), "" res, err = t.loginClient.Send(request) if err != nil {