mirror of
https://github.com/bitwarden/browser
synced 2026-02-21 03:43:58 +00:00
Try fixing Windows MakeCredential by retaining cipher cache and explicitly syncing autofill credentials
This commit is contained in:
@@ -319,10 +319,15 @@ fn send_registration_request(
|
||||
tracing::debug!("Sending registration request: {}", request_json);
|
||||
let callback = Arc::new(TimedCallback::new());
|
||||
ipc_client.prepare_passkey_registration(request, callback.clone());
|
||||
callback
|
||||
let response = callback
|
||||
.wait_for_response(Duration::from_secs(30))
|
||||
.map_err(|_| "Registration request timed out".to_string())?
|
||||
.map_err(|err| err.to_string())
|
||||
.map_err(|err| err.to_string());
|
||||
if response.is_ok() {
|
||||
tracing::debug!("Requesting credential sync after registering a new credential.");
|
||||
ipc_client.send_native_status("request-sync".to_string(), "".to_string());
|
||||
}
|
||||
response
|
||||
}
|
||||
|
||||
/// Creates a CTAP make credential response from Bitwarden's WebAuthn registration response
|
||||
|
||||
@@ -223,19 +223,7 @@ export class DesktopAutofillService implements OnDestroy {
|
||||
this.logService.error("listenPasskeyRegistration error", error);
|
||||
callback(error, null);
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// Windows does not prompt us to sync, so we need to sync immediately
|
||||
// after creating the credential so it shows up in the Windows Hello
|
||||
// credentials list.
|
||||
try {
|
||||
this.logService.info("Initiated FIDO2 sync after makeCredential")
|
||||
this.adHocSync();
|
||||
}
|
||||
catch (error) {
|
||||
this.logService.error("Failed to sync credentials after makeCredential", error);
|
||||
}
|
||||
}
|
||||
this.logService.info("Passkey registration completed.")
|
||||
});
|
||||
|
||||
ipc.autofill.listenPasskeyAssertionWithoutUserInterface(
|
||||
|
||||
@@ -190,7 +190,7 @@ export class Fido2AuthenticatorService<ParentWindowReference>
|
||||
}
|
||||
const reencrypted = await this.cipherService.encrypt(cipher, activeUserId);
|
||||
await this.cipherService.updateWithServer(reencrypted);
|
||||
await this.cipherService.clearCache(activeUserId);
|
||||
// await this.cipherService.clearCache(activeUserId);
|
||||
credentialId = fido2Credential.credentialId;
|
||||
} catch (error) {
|
||||
this.logService?.error(
|
||||
|
||||
Reference in New Issue
Block a user