mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 02:23:53 +02:00
feat: added posthog
This commit is contained in:
parent
80e4f1b798
commit
c96be7d9e1
18 changed files with 506 additions and 19 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
import { trackUserLoggedIn } from "@/lib/analytics";
|
||||
import { getAndClearRedirectPath, setBearerToken } from "@/lib/auth-utils";
|
||||
|
||||
interface TokenHandlerProps {
|
||||
|
|
@ -40,6 +41,10 @@ const TokenHandler = ({
|
|||
localStorage.setItem(storageKey, token);
|
||||
setBearerToken(token);
|
||||
|
||||
// Track successful login (works for both email and Google OAuth)
|
||||
const authType = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE || "GOOGLE";
|
||||
trackUserLoggedIn({ method: authType === "GOOGLE" ? "google" : "email" });
|
||||
|
||||
// Check if there's a saved redirect path from before the auth flow
|
||||
const savedRedirectPath = getAndClearRedirectPath();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue