diff --git a/.env b/.env new file mode 100644 index 0000000..9585291 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +VITE_BASE_URL = 'https://api.shinan.ir' +VITE_TOKEN_NAME = 'sh_admin_token' +VITE_REFRESH_TOKEN_NAME = 'sh_admin_token' \ No newline at end of file diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index e38571a..11d41e0 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -1,15 +1,10 @@ import { type FC } from 'react' import LogoImage from '../../assets/images/logo.svg' import LogoSmallImage from '../../assets/images/logo-small.svg' -import { useAuthStore } from './store/AuthStore' import LoginStep1 from './components/LoginStep1' -import LoginStep2 from './components/LoginStep2' -import LoginStep3 from './components/LoginStep3' const Login: FC = () => { - const { stepLogin, phone, email } = useAuthStore() - return (
{t('auth.enter_information')} -
+
diff --git a/src/pages/auth/components/LoginStep1.tsx b/src/pages/auth/components/LoginStep1.tsx
index c3089cc..473fdce 100644
--- a/src/pages/auth/components/LoginStep1.tsx
+++ b/src/pages/auth/components/LoginStep1.tsx
@@ -1,55 +1,50 @@
-import { FC } from 'react'
+import { type FC } from 'react'
import Input from '../../../components/Input'
import { useTranslation } from 'react-i18next'
-import { LoginType } from '../types/AuthTypes'
+import { type LoginWithPasswordType } from '../types/AuthTypes'
import { useFormik } from 'formik'
import * as Yup from 'yup'
import { useAuthStore } from '../store/AuthStore'
import Error from '../../../components/Error'
import Button from '../../../components/Button'
-import { isEmail } from '../../../config/func'
-import { useCheckHasAccount, useLoginWithOtp } from '../hooks/useAuthData'
+import { useLoginWithPassword } from '../hooks/useAuthData'
import { toast } from 'react-toastify'
-import { ErrorType } from '../../../helpers/types'
+import { type ErrorType } from '../../../helpers/types'
+import { setRefreshToken, setToken } from '../../../config/func'
+import { Pages } from '../../../config/Pages'
const LoginStep1: FC = () => {
const { t } = useTranslation('global')
- const { setPhone, phone, setStepLogin, setEmail } = useAuthStore()
- const loginWithOtp = useLoginWithOtp()
- const checkHasAccount = useCheckHasAccount()
+ const { setEmail } = useAuthStore()
+ const loginWithPassword = useLoginWithPassword()
- const formik = useFormik
-
- {t('auth.enter_your_password')} -
-