default login values removed

This commit is contained in:
victorAnumudu
2023-04-14 21:55:18 +01:00
parent 500c54d442
commit 9376f96543
2 changed files with 8 additions and 7 deletions
+2 -4
View File
@@ -23,8 +23,8 @@ const loginSchema = Yup.object().shape({
})
const initialValues = {
email: 'demo@float.sg',
password: '****',
email: '',
password: '',
}
//email: 'admin@demo.com',
/*
@@ -45,10 +45,8 @@ export function Login() {
setLoading(true)
try {
const {data: auth} = await login(values.email, values.password)
console.log('yes')
saveAuth(auth)
// const {data: user} = await getUserByToken(auth.session_token)
console.log('yes2')
// setCurrentUser(user)
setCurrentUser(auth.profile)
navigate('/dashboard')
+6 -3
View File
@@ -69,9 +69,12 @@ const AuthInit: FC<WithChildren> = ({children}) => {
const requestUser = async (apiToken: string) => {
try {
if (!didRequest.current) {
const {data} = await getUserByToken(apiToken)
if (data) {
setCurrentUser(data)
// const {data} = await getUserByToken(apiToken)
// if (data) {
// setCurrentUser(data)
// }
if (localStorage.getItem('kt-auth-react-v')) {
setCurrentUser(auth.profile)
}
}
} catch (error) {