From 935cd7b7c9ceeb177b6c05021dd85e10591d1fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=84=88=EC=9D=B4=EB=A6=84?= <너이메일> Date: Mon, 11 May 2026 06:25:40 +0900 Subject: [PATCH] fix(auth): remove redundant token storage write --- surfsense_web/app/auth/callback/page.tsx | 6 +----- surfsense_web/components/TokenHandler.tsx | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/surfsense_web/app/auth/callback/page.tsx b/surfsense_web/app/auth/callback/page.tsx index 4050eefb6..da1755835 100644 --- a/surfsense_web/app/auth/callback/page.tsx +++ b/surfsense_web/app/auth/callback/page.tsx @@ -8,11 +8,7 @@ export default function AuthCallbackPage() { // TokenHandler uses useGlobalLoadingEffect to show the loading screen return ( - + ); } diff --git a/surfsense_web/components/TokenHandler.tsx b/surfsense_web/components/TokenHandler.tsx index e81a1bf2b..97e937526 100644 --- a/surfsense_web/components/TokenHandler.tsx +++ b/surfsense_web/components/TokenHandler.tsx @@ -9,7 +9,6 @@ import { trackLoginSuccess } from "@/lib/posthog/events"; interface TokenHandlerProps { redirectPath?: string; // Default path to redirect after storing token (if no saved path) tokenParamName?: string; // Name of the URL parameter containing the token - storageKey?: string; // Key to use when storing in localStorage (kept for backwards compatibility) } /** @@ -19,12 +18,10 @@ interface TokenHandlerProps { * * @param redirectPath - Default path to redirect after storing token (default: '/dashboard') * @param tokenParamName - Name of the URL parameter containing the token (default: 'token') - * @param storageKey - Key to use when storing in localStorage (default: 'surfsense_bearer_token') */ const TokenHandler = ({ redirectPath = "/dashboard", tokenParamName = "token", - storageKey = "surfsense_bearer_token", }: TokenHandlerProps) => { // Always show loading for this component - spinner animation won't reset useGlobalLoadingEffect(true); @@ -45,7 +42,6 @@ const TokenHandler = ({ } sessionStorage.removeItem("login_success_tracked"); - localStorage.setItem(storageKey, token); setBearerToken(token); if (refreshToken) { @@ -78,7 +74,7 @@ const TokenHandler = ({ }; run(); - }, [tokenParamName, storageKey, redirectPath]); + }, [tokenParamName, redirectPath]); // Return null - the global provider handles the loading UI return null;