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; requireResidentKey: string;
rpEntityName: string; rpEntityName: string;
rpId: string; rpId: string;
signatureAlgorithms: string; signatureAlgorithms: string[];
unsupportedBrowserText: string; unsupportedBrowserText: string;
userId: string; userId: string;
userVerificationRequirement: UserVerificationRequirement | 'not specified'; userVerificationRequirement: UserVerificationRequirement | 'not specified';
@ -61,16 +61,16 @@ document.addEventListener('alpine:init', () => {
username, username,
} = this.$store.webAuthnRegister; } = this.$store.webAuthnRegister;
const getPubKeyCredParams = (signatureAlgorithms: string) => { const getPubKeyCredParams = (signatureAlgorithms: string[]) => {
const pubKeyCredParams: PublicKeyCredentialParameters[] = []; const pubKeyCredParams: PublicKeyCredentialParameters[] = [];
if (signatureAlgorithms === '') { if (signatureAlgorithms.length == 0) {
pubKeyCredParams.push({ alg: -7, type: 'public-key' }); pubKeyCredParams.push({ alg: -7, type: 'public-key' });
return pubKeyCredParams; return pubKeyCredParams;
} }
const signatureAlgorithmsList = signatureAlgorithms.split(','); const signatureAlgorithmsList = signatureAlgorithms;
signatureAlgorithmsList.forEach((value) => { signatureAlgorithmsList.forEach((value) => {
pubKeyCredParams.push({ pubKeyCredParams.push({

View file

@ -44,7 +44,7 @@
requireResidentKey: '${requireResidentKey}', requireResidentKey: '${requireResidentKey}',
rpEntityName: '${rpEntityName}', rpEntityName: '${rpEntityName}',
rpId: '${rpId}', rpId: '${rpId}',
signatureAlgorithms: '${signatureAlgorithms}', signatureAlgorithms: [${signatureAlgorithms?join(",")}],
unsupportedBrowserText: '${msg("webauthn-unsupported-browser-text")?no_esc}', unsupportedBrowserText: '${msg("webauthn-unsupported-browser-text")?no_esc}',
userId: '${userid}', userId: '${userid}',
userVerificationRequirement: '${userVerificationRequirement}', userVerificationRequirement: '${userVerificationRequirement}',