react native - Cannot read property 'reload' of null using firebase.auth().currentUser.reload()


Question: 

I need to reload current user to update emailVerfied status. However At first login or signup of user. The app return an error that Cannot read property 'reload' of null when A user press triggers firebase.auth().currentUser.reload(). However If I refresh the reload the app the reload function works fine. I need to trigger reload at a user action right after a user logged in. I am already using onAuthChanged and through this observer the currentUser exists and a console.log does print out the current user. However, at initial login after the console statement of authStatedChanged reload() function is stating null for the current User.




1 Answer: 

firebase.currentUser.reload() should be firebase.auth().currentUser.reload() Also make sure the currentUser is ready (after onAuthStateChanged listener triggers).

 

More Articles


Logs showing WARNING when trying to credit bank accounts with Balanced Payments

Been seeing this in my logs today. ############################################################# # WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! # ############################################################# Using positional arguments is **DEPRECATED**. Please use the keyword optio

node.js - BotBuilder TypeError: builder.ConsoleConnector is not a constructor

I'm following the official quick start of Microsoft Bot Builder(SDK v3) for NodeJs: Create a bot with the Bot Builder SDK for Node.js 1- I made a new project with npm init2- then npm install --save botbuilder3- then I created a new file "app.js"var builder = require('botbuilder');var connector =

I came across the new Stack Overflow Bot by Microsoft on the Stack Overflow blog and decided to give it a try.After installing Node V8.1.4 for macOS, I installed the bot by running npm install in the StackBot directory. There weren't many issues, except for a warning returned.MacBook-Air:StackBot US


Firefox extension to get google pagerank and alexa ranking

I am creating a Mozilla Firefox toolbar to show PageRank and Alexa ranking of current website. One way I came to know is to use XMLHttpRequest in my JavaScript file to get information from a PHP page hosted on my website's server. The PHP class has this function:function check($page) {// Open a soc

ruby - rails and balanced payments - Tokenize and add bank account

I'm using balanced payments with my rails 4 app and I need some help on how to tokenize and add a bank account. I'm not sure what I'm doing wrong. I read the docs and followed this gist . I'm getting a 200 ok status and I don't see any errors in the logs. However, when i check the response on my tes

php - Payflow Pro Currency Configuration Issue

I am new to the Payflow Pro platform and have recently set up single and recurring transactions in the sandbox mode and they all work fine.My issue is i am unable to configure the test payflow manager to accept and work with another currency other than USD. I need to be able to use GBP. When I first


With Actions on Google, what is the recommended way to get the user's country with coarse location information?

The getDeviceLocation() call may return either lat/lon coordinates if the surface provides precise location information or a ZIP code and a city for coarse location information.With the former one can use the Google Maps API to reverse-geocode the coordinates, the latter, however, can be ambiguous a

actions on google - Request Sync always returns 404 : "Error: Requested entity was not found."

I'm having a hard time implementing requestSync. It always returns "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" }I use Node.js/Express for the backend. The linking/unlinking with the Google Home app work and my actions work as well. It's rea

java - How can I use the response from a JOptionPane?

This is the first time I have used a confirm box and I'd like some advice on how to use it please, I want to use the users input of "Yes or No" but not sure how to do it? If I wanted to reference the input from the JOptionPane in an if statement how would go about it?JOptionPane.showConfirmDialog(nu

dialogflow - how to define 'App' statement in firestore database?

I have to define 'app' inorder to store user details from dialogflow to firestore databaseconst app = new App({request:request, response:response});inorder to use this line of code i need 'App' to be defined in firestore code,for which i have used this line,const App = require('firebase-functions')