fix: wrap development errors in auth changes
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user