Skip to content

Commit

Permalink
Release: v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama authored Feb 3, 2024
2 parents 35c1c23 + f770183 commit 97f4ba9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/(editor)/editor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function getStoryData({ path }: PageProps['searchParams']): Promise<ISbRes
* You can extend that by adjusting 3600 with the value you need.
*/
const validateEditor = (searchParams: PageProps['searchParams']) => {
const validationString = searchParams['_storyblok_tk[space_id]'] + ':' + process.env.STORYBLOK_ACCESS_TOKEN + ':' + searchParams['_storyblok_tk[timestamp]'];
const validationString = searchParams['_storyblok_tk[space_id]'] + ':' + process.env.STORYBLOK_PREVIEW_EDITOR_TOKEN + ':' + searchParams['_storyblok_tk[timestamp]'];
const validationToken = crypto.createHash('sha1').update(validationString).digest('hex');
if (searchParams['_storyblok_tk[token]'] == validationToken &&
Number(searchParams['_storyblok_tk[timestamp]']) > Math.floor(Date.now()/1000)-3600) {
Expand Down

0 comments on commit 97f4ba9

Please sign in to comment.