Relative Content

Tag Archive for javascriptreactjsfirebasenext.js

How to use the getIdToken method of firebase user after page reload in nextjs

I am working on a nextjs project, for user authentications I am using firebase’s signInWithPhoneNumber for phone number verification, after successfull verification I get a firebase user which also has the getIdToken method to fetch a new token. My problem is after I refresh the page I cannot use this method to fetch a token as the currentUser user becomes undefined after page reload.