I get this error when the profile page(redirects from login) finishes loading 'Unhandled Rejection (TypeError): Cannot read property 'email' of null'. Can someone explain how I could wait for the state to set before executing another code
Use the onAuthState
listener like here:
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
}
});
You can find more about it here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.