mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
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:
parent
458c152032
commit
d20aef2957
8 changed files with 84 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ export function GoogleLoginButton() {
|
|||
trackLoginAttempt("google");
|
||||
|
||||
// IMPORTANT: Use the redirect-based authorize endpoint for cross-origin OAuth
|
||||
// This fixes CSRF cookie issues in Firefox/Safari where cookies set via
|
||||
// This fixes CSRF cookie issues in Firefox/Safari where cookies set via
|
||||
// cross-origin fetch requests may not be sent on subsequent redirects.
|
||||
// The authorize-redirect endpoint does a server-side redirect to Google
|
||||
// and sets the CSRF cookie properly for same-site context.
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ export function LocalLoginForm() {
|
|||
// Track successful login
|
||||
trackLoginSuccess("local");
|
||||
|
||||
// Set flag so TokenHandler knows local login was already tracked
|
||||
if (typeof window !== "undefined") {
|
||||
sessionStorage.setItem("login_success_tracked", "true");
|
||||
}
|
||||
|
||||
// Success toast
|
||||
toast.success(t("login_success"), {
|
||||
id: loadingToast,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue