From 567ddca9e696c389cae49ae3f3643d72fe341de3 Mon Sep 17 00:00:00 2001 From: NiceAesth Date: Tue, 13 Oct 2026 15:52:58 -0300 Subject: [PATCH 1/2] retry 2fa on status code 409 --- Sources/DeveloperPortal/Authentication.swift | 49 ++++++++++++-------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/Sources/DeveloperPortal/Authentication.swift b/Sources/DeveloperPortal/Authentication.swift index f60d4c6..a4047d6 100644 --- a/Sources/DeveloperPortal/Authentication.swift +++ b/Sources/DeveloperPortal/Authentication.swift @@ -9,6 +9,10 @@ import Foundation import GSACryptoKit +private enum PushedCodeState { + @TaskLocal static var handled = false +} + public extension DeveloperPortal { func authenticate(appleID unsanitizedAppleID: String, @@ -190,6 +194,7 @@ public extension DeveloperPortal { let statusDictionary = completeResponseDictionary["Status"] as? [String: any Sendable] let authType = (statusDictionary?["au"] as? String) ?? (completeResponseDictionary["au"] as? String) + ?? ((statusDictionary?["hsc"] as? Int) == 409 && anisetteData.clientInfo.contains(" Date: Tue, 13 Oct 2026 15:54:52 -0300 Subject: [PATCH 2/2] well windows was doing this too so --- Sources/DeveloperPortal/Authentication.swift | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/DeveloperPortal/Authentication.swift b/Sources/DeveloperPortal/Authentication.swift index a4047d6..0b8e0f2 100644 --- a/Sources/DeveloperPortal/Authentication.swift +++ b/Sources/DeveloperPortal/Authentication.swift @@ -189,18 +189,18 @@ public extension DeveloperPortal { } verboseLog("[SideSign] Parse complete. dsid: \(dsid), token: \(idmsToken)") - + // 2FA auth type let statusDictionary = completeResponseDictionary["Status"] as? [String: any Sendable] let authType = (statusDictionary?["au"] as? String) ?? (completeResponseDictionary["au"] as? String) - ?? ((statusDictionary?["hsc"] as? Int) == 409 && anisetteData.clientInfo.contains("