mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[EC-598] chore: add some more console logs for debugging
This commit is contained in:
@@ -18,7 +18,7 @@ navigator.credentials.create = async (
|
|||||||
// return await browserCredentials.create(options);
|
// return await browserCredentials.create(options);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
console.log(options.publicKey);
|
console.log("navigator.credentials.create", options.publicKey);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await messenger.request(
|
const response = await messenger.request(
|
||||||
@@ -49,7 +49,9 @@ navigator.credentials.create = async (
|
|||||||
return mappedResult;
|
return mappedResult;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error && error.fallbackRequested) {
|
if (error && error.fallbackRequested) {
|
||||||
return await browserCredentials.create(options);
|
const browserResponse = await browserCredentials.create(options);
|
||||||
|
console.log("browserResponse", browserResponse);
|
||||||
|
return browserResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
@@ -60,6 +62,7 @@ navigator.credentials.get = async (
|
|||||||
options?: CredentialRequestOptions,
|
options?: CredentialRequestOptions,
|
||||||
abortController?: AbortController
|
abortController?: AbortController
|
||||||
): Promise<Credential> => {
|
): Promise<Credential> => {
|
||||||
|
console.log("navigator.credentials.get()", options);
|
||||||
try {
|
try {
|
||||||
const response = await messenger.request(
|
const response = await messenger.request(
|
||||||
{
|
{
|
||||||
@@ -70,16 +73,19 @@ navigator.credentials.get = async (
|
|||||||
abortController
|
abortController
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("Response from background", response);
|
||||||
|
|
||||||
if (response.type !== MessageType.CredentialGetResponse) {
|
if (response.type !== MessageType.CredentialGetResponse) {
|
||||||
throw new Error("Something went wrong.");
|
throw new Error("Something went wrong.");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(response.result);
|
|
||||||
|
|
||||||
return WebauthnUtils.mapCredentialAssertResult(response.result);
|
return WebauthnUtils.mapCredentialAssertResult(response.result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("Error from background", error);
|
||||||
if (error && error.fallbackRequested) {
|
if (error && error.fallbackRequested) {
|
||||||
return await browserCredentials.get(options);
|
const browserResponse = await browserCredentials.get(options);
|
||||||
|
console.log("browserResponse", browserResponse);
|
||||||
|
return browserResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user