Skip to content

Commit

Permalink
Fix initial authentication attempt with 2FA (#331)
Browse files Browse the repository at this point in the history
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 #326

Co-authored-by: Majd Alfhaily <[email protected]>
  • Loading branch information
tux-mind and majd authored Jan 19, 2025
1 parent f3c9076 commit 21cbd59
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/appstore/appstore_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 21cbd59

Please sign in to comment.