Skip to content

Commit c89a6b9

Browse files
authored
fix(auth): fix visionOS build failure in WebAuthn credential registration (#4250)
excludedCredentials comes from the ASAuthorizationWebBrowserPlatformPublicKeyCredentialRegistrationRequest protocol, which AuthenticationServices marks unavailable on visionOS, so any visionOS build of AWSCognitoAuthPlugin fails to compile. Guard the assignment with #if !os(visionOS). Fixes #4237
1 parent 62faa46 commit c89a6b9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignIn/WebAuthn/PlatformWebAuthnCredentials.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ extension PlatformWebAuthnCredentials: CredentialRegistrantProtocol {
113113
name: options.user.name,
114114
userID: options.user.id
115115
)
116+
#if !os(visionOS)
117+
// `excludedCredentials` is not available on visionOS
116118
platformKeyRequest.excludedCredentials = options.excludeCredentials.compactMap { credential in
117119
return .init(credentialID: credential.id)
118120
}
121+
#endif
119122

120123
return try await withCheckedThrowingContinuation { continuation in
121124
registrationContinuation = continuation

0 commit comments

Comments
 (0)