fixs, Убрал стейты для формы авторизации, переписал на форм дату

This commit is contained in:
2023-01-25 16:50:36 +03:00
parent 50f33071bb
commit 5c8a8160bd
21 changed files with 107 additions and 209 deletions

View File

@ -1,4 +1,4 @@
import React from 'react'
import React, {useEffect} from 'react'
import { AuthBox } from '../../components/AuthBox/AuthBox'
@ -20,10 +20,14 @@ const AuthForDevelopers = () => {
const isAuth = useSelector(selectAuth);
let navigate = useNavigate();
const getToken = localStorage.getItem('auth_token')
useEffect(()=> {
if (isAuth || getToken) {
navigate('/profile')
}
}, [getToken]);
if (isAuth) {
navigate('/profile')
}
return (
<section className='auth-developers'>