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.
13 lines
361 B
TypeScript
13 lines
361 B
TypeScript
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" />;
|
|
}
|