Open-source marketplace for AI Agent skills. Features: - Next.js 15 web app with i18n (en/fa) - CLI tool for skill installation (npx skillhub) - GitHub crawler/indexer with multi-strategy discovery - Security scanning for all indexed skills - Self-hostable with Docker Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
497 B
TypeScript
22 lines
497 B
TypeScript
'use client';
|
|
|
|
import { useEffect } from 'react';
|
|
import { initializeCsrfToken } from '@/lib/csrf-client';
|
|
|
|
interface CsrfProviderProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
/**
|
|
* Provider component that initializes the CSRF token on mount.
|
|
* This ensures the token is available for protected API requests.
|
|
*/
|
|
export function CsrfProvider({ children }: CsrfProviderProps) {
|
|
useEffect(() => {
|
|
// Initialize CSRF token on mount
|
|
initializeCsrfToken();
|
|
}, []);
|
|
|
|
return <>{children}</>;
|
|
}
|