mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
merge dev
This commit is contained in:
parent
a5d47cae31
commit
101dd5745c
2 changed files with 18 additions and 1 deletions
|
|
@ -7,7 +7,13 @@ import { cn } from "@/lib/utils";
|
||||||
export const Logo = ({ className }: { className?: string }) => {
|
export const Logo = ({ className }: { className?: string }) => {
|
||||||
return (
|
return (
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<Image src="/icon-128.svg" className={cn("dark:invert", className)} alt="logo" width={128} height={128} />
|
<Image
|
||||||
|
src="/icon-128.svg"
|
||||||
|
className={cn("dark:invert", className)}
|
||||||
|
alt="logo"
|
||||||
|
width={128}
|
||||||
|
height={128}
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { getAndClearRedirectPath, setBearerToken } from "@/lib/auth-utils";
|
import { getAndClearRedirectPath, setBearerToken } from "@/lib/auth-utils";
|
||||||
|
import { trackLoginSuccess } from "@/lib/posthog/events";
|
||||||
|
|
||||||
interface TokenHandlerProps {
|
interface TokenHandlerProps {
|
||||||
redirectPath?: string; // Default path to redirect after storing token (if no saved path)
|
redirectPath?: string; // Default path to redirect after storing token (if no saved path)
|
||||||
|
|
@ -35,6 +36,16 @@ const TokenHandler = ({
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
try {
|
try {
|
||||||
|
// Track login success for OAuth flows (e.g., Google)
|
||||||
|
// Local login already tracks success before redirecting here
|
||||||
|
const alreadyTracked = sessionStorage.getItem("login_success_tracked");
|
||||||
|
if (!alreadyTracked) {
|
||||||
|
// This is an OAuth flow (Google login) - track success
|
||||||
|
trackLoginSuccess("google");
|
||||||
|
}
|
||||||
|
// Clear the flag for future logins
|
||||||
|
sessionStorage.removeItem("login_success_tracked");
|
||||||
|
|
||||||
// Store token in localStorage using both methods for compatibility
|
// Store token in localStorage using both methods for compatibility
|
||||||
localStorage.setItem(storageKey, token);
|
localStorage.setItem(storageKey, token);
|
||||||
setBearerToken(token);
|
setBearerToken(token);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue