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,6 +21,7 @@ const withAuthentication = Component => {
this.listener = this.props.firebase.auth.onAuthStateChanged(
authUser => {
localStorage.setItem("authUser", JSON.stringify(authUser))
if (authUser) {
this.setState({
authUser: {
uid: authUser.uid,
@@ -28,6 +29,7 @@ const withAuthentication = Component => {
emailVerified: authUser.emailVerified,
},
})
}
},
() => {
localStorage.removeItem("authUser")