Wire frontend login to user_login.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4eed6b2e87
commit
92be5ee3d2
4 files changed
+16
-14
No files matched your search
@@ -4,7 +4,7 @@ import { errorMessage } from '../../services/apiClient.ts';
|
||||
|
||||
const LoginForm: React.FC = () => {
|
||||
const { login } = useAuth();
|
||||
const [userName, setUserName] = useState('');
|
||||
const [userLogin, setUserLogin] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@@ -14,7 +14,7 @@ const LoginForm: React.FC = () => {
|
||||
setError('');
|
||||
setIsLoading(true);
|
||||
try {
|
||||
await login(userName, password);
|
||||
await login(userLogin, password);
|
||||
} catch (err) {
|
||||
setError(errorMessage(err));
|
||||
} finally {
|
||||
@@ -30,20 +30,20 @@ const LoginForm: React.FC = () => {
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<label htmlFor="username" className="block text-sm font-medium text-gray-700">
|
||||
Username
|
||||
<label htmlFor="user_login" className="block text-sm font-medium text-gray-700">
|
||||
Login
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
id="username"
|
||||
name="username"
|
||||
id="user_login"
|
||||
name="user_login"
|
||||
type="text"
|
||||
autoComplete="username"
|
||||
required
|
||||
value={userName}
|
||||
onChange={(e) => setUserName(e.target.value)}
|
||||
value={userLogin}
|
||||
onChange={(e) => setUserLogin(e.target.value)}
|
||||
className="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm"
|
||||
placeholder="Nama pengguna"
|
||||
placeholder="Login pengguna"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user