fix: Template error #101

This commit is contained in:
EvATive7 2024-09-16 22:54:01 +08:00
parent bdf966fdae
commit 3339aa5304
2 changed files with 5 additions and 5 deletions

View file

@ -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({

View file

@ -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}',