fix: convert password to string instead of stringify by JSON

This commit is contained in:
Trần Đức Nam 2025-01-21 15:59:39 +07:00
parent d595a9e6b7
commit 10063e1247
No known key found for this signature in database

View File

@ -245,7 +245,7 @@ export async function renderPage(
if (cfg.passProtected?.enabled && componentData.fileData.frontmatter?.password) { if (cfg.passProtected?.enabled && componentData.fileData.frontmatter?.password) {
componentData.encryptedContent = await getEncryptedPayload( componentData.encryptedContent = await getEncryptedPayload(
render(content), render(content),
JSON.stringify(componentData.fileData.frontmatter.password), componentData.fileData.frontmatter.password.toString(),
cfg.passProtected?.iteration, cfg.passProtected?.iteration,
) )
content = <Encrypted {...componentData} /> content = <Encrypted {...componentData} />