diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 1394ccad..7c47462f 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -90,7 +90,6 @@ export default async function getPageProperties(id, block, schema, authToken, ta properties.pageCover = mapImgUrl(block[id].value?.format?.page_cover, block[id].value) ?? '' properties.pageCoverThumbnail = mapImgUrl(block[id].value?.format?.page_cover, block[id].value, 'block', 'pageCoverThumbnail') ?? '' properties.content = value.content ?? [] - properties.password = properties.password ? md5(properties.slug + properties.password) : '' properties.tagItems = properties?.tags?.map(tag => { return { name: tag, color: tagOptions?.find(t => t.value === tag)?.color || 'gray' } }) || [] @@ -106,6 +105,7 @@ export default async function getPageProperties(id, block, schema, authToken, ta properties.to = properties.slug ?? null properties.name = properties.title ?? '' } + properties.password = properties.password ? md5(properties.slug + properties.password) : '' return properties } diff --git a/pages/[...slug].js b/pages/[...slug].js index df93576c..65be2306 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -28,6 +28,7 @@ const Slug = props => { */ const validPassword = passInput => { const encrypt = md5(post.slug + passInput) + console.log('passInput', passInput, post.slug) if (passInput && encrypt === post.password) { setLock(false) return true