A small explanation for users visiting the sample Crypto dashboard. That's a public dashboard which all users can access and modify in the same time. Firebase propagates changes in real-time so you may see widgets moving around while other users are playing with the dashboard.
Should I be using the RedirectRoute widget when I want to redirect to a login page? I want to check a user object to see if the user is logged in, I would like to bind the url to the login and redirect. I am using AWS Cognito hosted UI so I can't slip it into an iframe. Any suggestions would be most appreciated.
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:
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.
3 comments
[ 2.8 ms ] story [ 20.4 ms ] threadThanks
<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/...