A social knowledge tool for researchers built on ATProto

feat: add loading state to login page during authentication check

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+16
+16
src/webapp/app/login/page.tsx
··· 15 15 PasswordInput, 16 16 Text, 17 17 Group, 18 + Loader, 18 19 } from '@mantine/core'; 19 20 import { getAccessToken } from '@/services/auth'; 20 21 ··· 24 25 const [isLoading, setIsLoading] = useState(false); 25 26 const [error, setError] = useState(''); 26 27 const [useAppPassword, setUseAppPassword] = useState(false); 28 + const [isCheckingAuth, setIsCheckingAuth] = useState(true); 27 29 const router = useRouter(); 28 30 const searchParams = useSearchParams(); 29 31 const { setTokens, isAuthenticated } = useAuth(); ··· 43 45 } else if (isAuthenticated && !isExtensionLogin) { 44 46 // If user is already authenticated and not doing extension login, redirect to library 45 47 router.push('/library'); 48 + } else { 49 + // Auth check is complete, show the login form 50 + setIsCheckingAuth(false); 46 51 } 47 52 }, [isExtensionLogin, isAuthenticated]); 48 53 ··· 130 135 setIsLoading(false); 131 136 } 132 137 }; 138 + 139 + // Show loading while checking authentication status 140 + if (isCheckingAuth || isAuthenticated) { 141 + return ( 142 + <Center h={'100svh'}> 143 + <Stack align="center"> 144 + <Loader size="lg" /> 145 + </Stack> 146 + </Center> 147 + ); 148 + } 133 149 134 150 return ( 135 151 <Center h={'100svh'}>