This commit is contained in:
Manav Rathi 2024-06-07 13:15:29 +05:30
parent b07841f972
commit a8834f5d7e
No known key found for this signature in database

View File

@ -23,7 +23,9 @@ const accountsAuthenticatedRequestHeaders = (): Record<string, string> => {
const token = getToken();
if (!token) throw new Error("Missing accounts token");
const headers: Record<string, string> = { "X-Auth-Token": token };
const clientPackage = nullToUndefined(localStorage.get("clientPackage"));
const clientPackage = nullToUndefined(
localStorage.getItem("clientPackage"),
);
if (clientPackage) headers["X-Client-Package"] = clientPackage;
return headers;
};
@ -123,6 +125,13 @@ export const getPasskeyRegistrationOptions = async () => {
return await res.json();
};
interface PasskeyRegistrationOptions {
sessionID: string;
options: {
publicKey: PublicKeyCredentialCreationOptions;
};
}
const finishPasskeyRegistration = async (
friendlyName: string,
credential: Credential,