feat: enhance login tracking and logout functionality

- Added session storage flag to track local login success, ensuring OAuth flows do not double track login events.
- Implemented tracking for logout events in both UserDropdown and AppSidebar components, resetting PostHog identity accordingly.
- Minor formatting adjustments in GoogleLoginButton and footer-new components for consistency.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-01-02 01:10:16 -08:00
parent 458c152032
commit d20aef2957
8 changed files with 84 additions and 4 deletions

View file

@ -3,6 +3,7 @@
import { PostHogProvider as PHProvider } from "@posthog/react";
import posthog from "posthog-js";
import type { ReactNode } from "react";
import { PostHogIdentify } from "./PostHogIdentify";
interface PostHogProviderProps {
children: ReactNode;
@ -11,5 +12,10 @@ interface PostHogProviderProps {
export function PostHogProvider({ children }: PostHogProviderProps) {
// posthog-js is already initialized in instrumentation-client.ts
// We just need to wrap the app with the PostHogProvider for hook access
return <PHProvider client={posthog}>{children}</PHProvider>;
return (
<PHProvider client={posthog}>
<PostHogIdentify />
{children}
</PHProvider>
);
}