|
|
@@ -41,7 +41,7 @@ import iAmSmartICon from 'assets/images/icons/icon_iAmSmart.png'; |
|
|
|
import {useDispatch} from "react-redux"; |
|
|
|
import {handleLogin} from "auth/index"; |
|
|
|
import useJwt from "../../../auth/jwt/useJwt"; |
|
|
|
|
|
|
|
import { handleLogoutFunction } from 'auth/index'; |
|
|
|
// ============================|| FIREBASE - LOGIN ||============================ // |
|
|
|
|
|
|
|
const AuthLoginCustom = () => { |
|
|
@@ -65,11 +65,12 @@ const AuthLoginCustom = () => { |
|
|
|
|
|
|
|
const tryLogin = () => { |
|
|
|
if(isValid){ |
|
|
|
dispatch(handleLogoutFunction()); |
|
|
|
// setSumitting(true) |
|
|
|
useJwt |
|
|
|
.login({username: values.username, password: values.password}) |
|
|
|
.then((response) => { |
|
|
|
// console.log("123") |
|
|
|
console.log(response) |
|
|
|
const userData = { |
|
|
|
id: response.data.id, |
|
|
|
fullenName: response.data.name, |
|
|
@@ -92,7 +93,6 @@ const AuthLoginCustom = () => { |
|
|
|
console.error(error.response.data.error) |
|
|
|
setErrorMassage(error.response.data.error) |
|
|
|
setOpen(true) |
|
|
|
console.log("321") |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
setOpen(true) |
|
|
|