Information about the logged in user can usually be read from a cookie or localStorage. You can put that info in the store or use it on the route like this:
<RedirectRoute visible={()=>!userIsSignedIn()} redirect="~/sign-in" />
I'm not aware if AWS Cognito hosted UI offers info about the user or you need implement that on your own. Firebase offers the onAuthStateChanged callback which is used in this app.
https://github.com/codaxy/dashboards/blob/master/app/layout/...