diff --git a/src/data/webAuthnRegister.ts b/src/data/webAuthnRegister.ts index 23744df..0442ae3 100644 --- a/src/data/webAuthnRegister.ts +++ b/src/data/webAuthnRegister.ts @@ -26,7 +26,7 @@ type StoreType = { requireResidentKey: string; rpEntityName: string; rpId: string; - signatureAlgorithms: string; + signatureAlgorithms: string[]; unsupportedBrowserText: string; userId: string; userVerificationRequirement: UserVerificationRequirement | 'not specified'; @@ -61,16 +61,16 @@ document.addEventListener('alpine:init', () => { username, } = this.$store.webAuthnRegister; - const getPubKeyCredParams = (signatureAlgorithms: string) => { + const getPubKeyCredParams = (signatureAlgorithms: string[]) => { const pubKeyCredParams: PublicKeyCredentialParameters[] = []; - if (signatureAlgorithms === '') { + if (signatureAlgorithms.length == 0) { pubKeyCredParams.push({ alg: -7, type: 'public-key' }); return pubKeyCredParams; } - const signatureAlgorithmsList = signatureAlgorithms.split(','); + const signatureAlgorithmsList = signatureAlgorithms; signatureAlgorithmsList.forEach((value) => { pubKeyCredParams.push({ diff --git a/theme/keywind/login/webauthn-register.ftl b/theme/keywind/login/webauthn-register.ftl index 57f4dad..dfd0a91 100644 --- a/theme/keywind/login/webauthn-register.ftl +++ b/theme/keywind/login/webauthn-register.ftl @@ -44,7 +44,7 @@ requireResidentKey: '${requireResidentKey}', rpEntityName: '${rpEntityName}', rpId: '${rpId}', - signatureAlgorithms: '${signatureAlgorithms}', + signatureAlgorithms: [${signatureAlgorithms?join(",")}], unsupportedBrowserText: '${msg("webauthn-unsupported-browser-text")?no_esc}', userId: '${userid}', userVerificationRequirement: '${userVerificationRequirement}',