AnomalyInnovations / serverless-stack-demo-client

Source for the demo app client in the Serverless Stack Guide
https://demo2.serverless-stack.com
MIT License
635 stars 204 forks source link

Avoid rendering of unauthenticated content during authentication #24

Open forste opened 6 years ago

forste commented 6 years ago

this.setState({ isAuthenticating: false }); is called before this.userHasAuthenticated(true); finishes, which causes rendering unauthenticated content

jayair commented 6 years ago

@forste I don't think this change would work. The await is on the function userHasAuthenticated that does not return anything.

Both userHasAuthenticated and the this.setState({ isAuthenticating: false }) should get batched together. So you shouldn't have a case where the unauthenticated content is getting rendered.

Are you seeing otherwise?