From d15eafba4c3237d01bd63c7b188b6c4de43c3001 Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 24 Dec 2025 18:07:23 +0800 Subject: [PATCH] fix: prevent LoginPrompt flash on page refresh with stored token Add additional condition to check for the intermediate auth state where authSource exists but token hasn't been fetched yet. This prevents the LoginPrompt from briefly flashing when the page is refreshed and the user already has a stored access token. Changes the condition from just `isAuthLoading` to also cover the gap before the useAuth effect starts fetching the token, displaying the loading state instead of the login prompt. --- web/src/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index ae8b38ca..72c61060 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -154,8 +154,8 @@ export function App() { return } - // Authenticating - if (isAuthLoading) { + // Authenticating (also covers the gap before useAuth effect starts) + if (isAuthLoading || (authSource && !token && !authError)) { return (