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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user