
Show HN: Drag and drop dashboard builder based on CxJS and Firebase - mstijak
https://github.com/codaxy/dashboards
======
mstijak
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.

------
howler9443
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.

Thanks

~~~
mstijak
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/...](https://github.com/codaxy/dashboards/blob/master/app/layout/UserAccount.js)

