diff --git a/Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift b/Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift index ff1926c4..490e7ee5 100644 --- a/Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift +++ b/Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift @@ -11,4 +11,5 @@ import Foundation enum GrandSlamAuthMode: String, Decodable { case secondaryAuth case trustedDeviceSecondaryAuth -} + case repair +} \ No newline at end of file diff --git a/Sources/XKit/GrandSlam/Operations/GrandSlamAuthenticateOperation.swift b/Sources/XKit/GrandSlam/Operations/GrandSlamAuthenticateOperation.swift index 41405e5a..e61e1f61 100644 --- a/Sources/XKit/GrandSlam/Operations/GrandSlamAuthenticateOperation.swift +++ b/Sources/XKit/GrandSlam/Operations/GrandSlamAuthenticateOperation.swift @@ -110,6 +110,9 @@ struct GrandSlamAuthenticateOperation { // 2FA guard !isRetry else { throw Error.failedSecondaryAuth } let authMode = response.url.flatMap { GrandSlamAuthMode(rawValue: $0) } + if authMode == .repair { + return loginData + } return try await authenticateTwoFactor( mode: authMode, loginData: loginData diff --git a/Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift b/Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift index 5a41e027..601fbb5a 100644 --- a/Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift +++ b/Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift @@ -77,6 +77,8 @@ struct GrandSlamTwoFactorAuthenticateOperation { try await self.performSMSAuth() case .trustedDeviceSecondaryAuth: try await self.performTrustedDeviceAuth() + case .repair: + return case nil: // means 2FA was automatically requested try await validateCode() }