how to call an API when refreshing the page to let the background check session to determine whether it is logged in?
<Router>
<Provider store={store}>
<Switch>
<Route path="/login" component={Login}/>
<PrivateRoute path="/" component={MainLayout} />
</Switch>
</Provider>
</Router>
where should I put this ajax request?