fix: wrap development errors in auth changes

This commit is contained in:
Kyle Gill
2019-05-19 19:34:03 -06:00
parent f3030d8091
commit 8bde1e6b81

View File

@@ -21,13 +21,15 @@ const withAuthentication = Component => {
this.listener = this.props.firebase.auth.onAuthStateChanged( this.listener = this.props.firebase.auth.onAuthStateChanged(
authUser => { authUser => {
localStorage.setItem("authUser", JSON.stringify(authUser)) localStorage.setItem("authUser", JSON.stringify(authUser))
this.setState({ if (authUser) {
authUser: { this.setState({
uid: authUser.uid, authUser: {
email: authUser.email, uid: authUser.uid,
emailVerified: authUser.emailVerified, email: authUser.email,
}, emailVerified: authUser.emailVerified,
}) },
})
}
}, },
() => { () => {
localStorage.removeItem("authUser") localStorage.removeItem("authUser")