()
| 3 | import type { NextRouter } from 'next/router'; |
| 4 | |
| 5 | export default function PostHogUser() { |
| 6 | const session = useSession(); |
| 7 | |
| 8 | useEffect(() => { |
| 9 | if ( |
| 10 | session.status === 'authenticated' && |
| 11 | session.data.user?.email && |
| 12 | (window as any).posthog?.__loaded |
| 13 | ) { |
| 14 | (window as any).posthog?.identify(session.data.user.email, { |
| 15 | email: session.data.user.email, |
| 16 | }); |
| 17 | } |
| 18 | }, [session]); |
| 19 | |
| 20 | return null; |
| 21 | } |
| 22 | |
| 23 | export function handlePosthogId(router: NextRouter) { |
| 24 | if (router.query.phId) { |
nothing calls this directly
no test coverage detected