Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / browser / credentials.ts
blob8f0e6c5f6d8fb0d7cd9b56e36684d01a48fe313a
1 export async function storeCredentials(id: string, password: string) {
2     if (!navigator.credentials) {
3         return; // Feature not available
4     }
6     try {
7         // @ts-ignore
8         const cred = new window.PasswordCredential({
9             id,
10             password,
11         });
12         await navigator.credentials.store(cred);
13     } catch (e: any) {
14         // Firefox will crash because it thinks publicKey is mandatory inside cred.
15         // Even if the spec says otherwise
16         // Current API inside Firefox
17     }