|
|
@@ -57,6 +57,7 @@ const AuthLoginCustom = () => { |
|
|
|
const [isValid, setisValid] = useState(false); |
|
|
|
const [open, setOpen] = React.useState(false); |
|
|
|
const [isButtonDisabled, setIsButtonDisabled] = useState(true); |
|
|
|
const [errorMassage, setErrorMassage] = useState(''); |
|
|
|
|
|
|
|
const handleMouseDownPassword = (event) => { |
|
|
|
event.preventDefault(); |
|
|
@@ -68,7 +69,7 @@ const AuthLoginCustom = () => { |
|
|
|
useJwt |
|
|
|
.login({username: values.username, password: values.password}) |
|
|
|
.then((response) => { |
|
|
|
console.log("123") |
|
|
|
// console.log("123") |
|
|
|
const userData = { |
|
|
|
id: response.data.id, |
|
|
|
fullenName: response.data.name, |
|
|
@@ -87,8 +88,10 @@ const AuthLoginCustom = () => { |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
// setSuccess(false) |
|
|
|
setOpen(true) |
|
|
|
console.error(error) |
|
|
|
console.error(error.response.data.error) |
|
|
|
setErrorMassage(error.response.data.error) |
|
|
|
setOpen(true) |
|
|
|
console.log("321") |
|
|
|
}); |
|
|
|
}else{ |
|
|
@@ -271,7 +274,7 @@ const AuthLoginCustom = () => { |
|
|
|
</Stack> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<PasswordAlertDialog open={open} handleClose={handleClose}/> |
|
|
|
<PasswordAlertDialog open={open} handleClose={handleClose} errorMassage={errorMassage}/> |
|
|
|
</form> |
|
|
|
</FormikProvider> |
|
|
|
); |
|
|
|