diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03dc6..a4a7b3f5cf 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/next.config.js b/next.config.js index e3b9624895..00bc518a80 100644 --- a/next.config.js +++ b/next.config.js @@ -148,11 +148,26 @@ const moduleExports = withBundleAnalyzer({ locales, defaultLocale, }, - headers: () => { + headers: async () => { return [ + { + source: '/:path*', + locale: false, + headers: [ + { + key: 'X-Frame-Options', + value: 'SAMEORIGIN', + }, + { + key: 'Content-Security-Policy', + value: "frame-ancestors 'self'", + }, + ], + }, { // Adding CORS headers for /manifest.json source: '/manifest.json', + locale: false, headers: [ { key: 'Access-Control-Allow-Origin', diff --git a/src/components/views/verification/EmailVerificationIndex.tsx b/src/components/views/verification/EmailVerificationIndex.tsx index 3df9a7a3dd..d2a15227d3 100644 --- a/src/components/views/verification/EmailVerificationIndex.tsx +++ b/src/components/views/verification/EmailVerificationIndex.tsx @@ -78,10 +78,20 @@ export default function EmailVerificationIndex() { } function Verified() { + const [querySlug, setQuerySlug] = useState(undefined); const router = useRouter(); const { slug } = router.query; const { formatMessage } = useIntl(); + // we must wait for the router to be ready to get the slug from the query + useEffect(() => { + if (router.isReady) { + if (typeof slug === 'string') { + setQuerySlug(slug); + } + } + }, [router.isReady, slug]); + return ( <> - +