Commit 880b9f02 authored by Pavel Mishakov's avatar Pavel Mishakov

webinar done

parent 07b61617
...@@ -34,7 +34,7 @@ export const usersSlice = createSlice({ ...@@ -34,7 +34,7 @@ export const usersSlice = createSlice({
name: namespace, name: namespace,
initialState: { initialState: {
user: {} as IUser, user: {} as IUser,
isAuth: !!localStorage.getItem('token') || false, isAuth: false,
loadingUser: false, loadingUser: false,
messageUser: '' messageUser: ''
} as IUsersState, } as IUsersState,
......
...@@ -11,7 +11,7 @@ const PrivateRoute: React.FunctionComponent = (): React.ReactElement => { ...@@ -11,7 +11,7 @@ const PrivateRoute: React.FunctionComponent = (): React.ReactElement => {
const dispatch: AppDispatch = useDispatch() const dispatch: AppDispatch = useDispatch()
useEffect(() => { useEffect(() => {
dispatch(checkToken()) dispatch(checkToken())
}, [isAuth]) }, [])
return ( return (
isAuth isAuth
? ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment