mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 04:12:47 +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 }) => {
|
||||
return (
|
||||
<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>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
import { useSearchParams } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
import { getAndClearRedirectPath, setBearerToken } from "@/lib/auth-utils";
|
||||
import { trackLoginSuccess } from "@/lib/posthog/events";
|
||||
|
||||
interface TokenHandlerProps {
|
||||
redirectPath?: string; // Default path to redirect after storing token (if no saved path)
|
||||
|
|
@ -35,6 +36,16 @@ const TokenHandler = ({
|
|||
|
||||
if (token) {
|
||||
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
|
||||
localStorage.setItem(storageKey, token);
|
||||
setBearerToken(token);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue