Fix Login loading state check to prevent infinite loading

cgen-25a68a3457824b3394a0d914af3b0f4e
This commit is contained in:
Builder.io 2025-08-16 04:21:10 +00:00
parent 9a99b23ca7
commit 03ca1fa22f

View file

@ -83,7 +83,8 @@ export default function Login() {
}
};
if (isLoading) {
// Show loading screen only during form submission, not during auth context loading
if (isLoading && !loading) {
return (
<LoadingScreen
message="Authenticating your account..."
@ -93,6 +94,17 @@ export default function Login() {
);
}
// If auth context is still loading, show a different loading state
if (loading) {
return (
<LoadingScreen
message="Initializing AeThex OS..."
showProgress={true}
duration={3000}
/>
);
}
return (
<Layout>
<div className="min-h-screen bg-aethex-gradient py-12 flex items-center justify-center">