I have used a state variable in redux and change it after login. how can i use that to change if the user i logged in or not?
When i refresh the page, it redirects to the login page.
if(authError === "") return <Redirect to='/login/' />
return (
<div>
<Header />
<Router history={history}>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/contactus" component={ContactUs} />
<Route path="/jobsnearyou" component={JobsNearYou} />
<Route path="/CandidateChat" component={CandidateChat} />
<Route path="/myprofile" component={MyProfile} />
<Route path="/candidateprofile" component={CandidateProfile} />
<Route path="/employerprofile" component={EmployerProfile} />
</Switch>
</Router>
<Footer />
</div>
);
i change "authError=null" if logged in