mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: add FIDO2 credentials support in cipher handling and UI components
This commit is contained in:
@@ -63,11 +63,10 @@ function normalizeCipherForStorage(cipher: Cipher): Cipher {
|
||||
|
||||
export function normalizeCipherLoginForStorage(login: any): any {
|
||||
if (!login || typeof login !== 'object') return login ?? null;
|
||||
|
||||
const rest = { ...login };
|
||||
const passkeyField = ['f', 'i', 'd', 'o', '2', 'C', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's'].join('');
|
||||
delete (rest as Record<string, unknown>)[passkeyField];
|
||||
return rest;
|
||||
return {
|
||||
...login,
|
||||
fido2Credentials: Array.isArray(login.fido2Credentials) ? login.fido2Credentials : null,
|
||||
};
|
||||
}
|
||||
|
||||
export function normalizeCipherLoginForCompatibility(login: any): any {
|
||||
|
||||
@@ -183,6 +183,7 @@ export async function handleCiphersImport(request: Request, env: Env, userId: st
|
||||
})) || null,
|
||||
totp: c.login.totp ?? null,
|
||||
autofillOnPageLoad: c.login.autofillOnPageLoad ?? null,
|
||||
fido2Credentials: Array.isArray(c.login.fido2Credentials) ? c.login.fido2Credentials : null,
|
||||
uri: c.login.uri ?? null,
|
||||
passwordRevisionDate: c.login.passwordRevisionDate ?? null,
|
||||
} : null,
|
||||
|
||||
@@ -94,6 +94,7 @@ export interface CipherLogin {
|
||||
uris: CipherLoginUri[] | null;
|
||||
totp: string | null;
|
||||
autofillOnPageLoad: boolean | null;
|
||||
fido2Credentials: any[] | null;
|
||||
uri: string | null;
|
||||
passwordRevisionDate: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user