1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

Dynamically load MacOS passkey (#12897)

This commit is contained in:
Daniel García
2025-01-16 16:50:38 +01:00
committed by GitHub
parent 9a6f00ef11
commit 7c89c52098

View File

@@ -30,6 +30,7 @@ void runSync(void* context, NSDictionary *params) {
[mappedCredentials addObject:credential];
}
if (@available(macos 14, *)) {
if ([type isEqualToString:@"fido2"]) {
NSString *cipherId = credential[@"cipherId"];
NSString *rpId = credential[@"rpId"];
@@ -37,7 +38,8 @@ void runSync(void* context, NSDictionary *params) {
NSData *credentialId = decodeBase64URL(credential[@"credentialId"]);
NSData *userHandle = decodeBase64URL(credential[@"userHandle"]);
ASPasskeyCredentialIdentity *credential = [[ASPasskeyCredentialIdentity alloc]
Class passkeyCredentialIdentityClass = NSClassFromString(@"ASPasskeyCredentialIdentity");
id credential = [[passkeyCredentialIdentityClass alloc]
initWithRelyingPartyIdentifier:rpId
userName:userName
credentialID:credentialId
@@ -47,6 +49,7 @@ void runSync(void* context, NSDictionary *params) {
[mappedCredentials addObject:credential];
}
}
}
[ASCredentialIdentityStore.sharedStore replaceCredentialIdentityEntries:mappedCredentials
completion:^(__attribute__((unused)) BOOL success, NSError * _Nullable error) {