import { type FormEvent, useState } from 'react'; import { Navigate } from 'react-router'; import { useAuthStore } from './auth-store'; import styles from './LoginPage.module.css'; export function LoginPage() { const { isAuthenticated, login, loading, error } = useAuthStore(); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); if (isAuthenticated) return ; const handleSubmit = (e: FormEvent) => { e.preventDefault(); login(username, password); }; return (
cameleer3
Sign in to access the observability dashboard
setUsername(e.target.value)} autoFocus autoComplete="username" />
setPassword(e.target.value)} autoComplete="current-password" />
{error &&
{error}
}
); }