Posthog behoben

This commit is contained in:
Timo Knuth
2025-12-11 11:40:38 +01:00
parent 8c5e2fa58e
commit 18f92c4285
8 changed files with 141 additions and 34 deletions

View File

@@ -17,7 +17,16 @@ export default function AppLayout({
const { t } = useTranslation();
const [sidebarOpen, setSidebarOpen] = useState(false);
const handleSignOut = () => {
const handleSignOut = async () => {
// Track logout event before clearing data
try {
const { trackEvent, resetUser } = await import('@/components/PostHogProvider');
trackEvent('user_logout');
resetUser(); // Reset PostHog user session
} catch (error) {
console.error('PostHog tracking error:', error);
}
// Clear all cookies
document.cookie.split(";").forEach(c => {
document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");