diff --git a/src/components/LoginComponent.jsx b/src/components/LoginComponent.jsx index c3a9f92..c282141 100644 --- a/src/components/LoginComponent.jsx +++ b/src/components/LoginComponent.jsx @@ -7,16 +7,18 @@ import { Link } from 'react-router-dom'; import { Notification, NotificationGroup } from '@progress/kendo-react-notification'; const LoginComponent = ({ onLogin }) => { - const [username, setUsername] = useState(''); - const [password, setPassword] = useState(''); + // Get credentials from environment + const mockUsername = import.meta.env.VITE_MOCK_USERNAME; + const mockPassword = import.meta.env.VITE_MOCK_PASSWORD; + + // Prepopulate with demo credentials from env + const [username, setUsername] = useState(mockUsername); + const [password, setPassword] = useState(mockPassword); const [error, setError] = useState(''); const handleSubmit = (event) => { event.preventDefault(); - const mockUsername = import.meta.env.VITE_MOCK_USERNAME; - const mockPassword = import.meta.env.VITE_MOCK_PASSWORD; - if (username === mockUsername && password === mockPassword) { onLogin(true); } else { @@ -40,7 +42,15 @@ const LoginComponent = ({ onLogin }) => { setPassword(e.target.value)} autoComplete="current-password" /> -
+ Just click 'Login'. The credentials are already loaded for you. +