Moar Login Fixes (#4948)

This commit is contained in:
Dario Ghunney Ware
2025-11-20 20:51:53 +00:00
committed by GitHub
parent 76f2fd3b76
commit fca8470637
13 changed files with 1368 additions and 26 deletions
@@ -30,6 +30,14 @@ export default function Login() {
const [hasSSOProviders, setHasSSOProviders] = useState(false);
const [_enableLogin, setEnableLogin] = useState<boolean | null>(null);
// Redirect immediately if user has valid session (JWT already validated by AuthProvider)
useEffect(() => {
if (!loading && session) {
console.debug('[Login] User already authenticated, redirecting to home');
navigate('/', { replace: true });
}
}, [session, loading, navigate]);
// Fetch enabled SSO providers and login config from backend
useEffect(() => {
const fetchProviders = async () => {