Skip to content

Commit

Permalink
fix: Template error lukin#101
Browse files Browse the repository at this point in the history
  • Loading branch information
EvATive7 committed Sep 16, 2024
1 parent bdf966f commit 3339aa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/data/webAuthnRegister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type StoreType = {
requireResidentKey: string;
rpEntityName: string;
rpId: string;
signatureAlgorithms: string;
signatureAlgorithms: string[];
unsupportedBrowserText: string;
userId: string;
userVerificationRequirement: UserVerificationRequirement | 'not specified';
Expand Down Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion theme/keywind/login/webauthn-register.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down

0 comments on commit 3339aa5

Please sign in to comment.