Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ import Foundation
enum GrandSlamAuthMode: String, Decodable {
case secondaryAuth
case trustedDeviceSecondaryAuth
}
case repair
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down