Optimize content fetching and update configurations
Content fetching in the marketing section has been refactored to utilize the Next.js cache, which significantly improves performance. The date format of publishedAt has been updated to be more consistent across files. Code related to CSRF token, fonts, and metadata has been refactored into separate files for easier maintenance and readability.
This commit is contained in:
12
apps/web/components/csrf-token-meta.tsx
Normal file
12
apps/web/components/csrf-token-meta.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
/**
|
||||
* @description This component is used to render the CSRF token as a meta tag.
|
||||
* this tag can be retrieved for use in forms that require CSRF protection.
|
||||
* @constructor
|
||||
*/
|
||||
export function CsrfTokenMeta() {
|
||||
const csrf = headers().get('x-csrf-token') ?? '';
|
||||
|
||||
return <meta content={csrf} name="csrf-token" />;
|
||||
}
|
||||
Reference in New Issue
Block a user