quickstart-nodejs icon indicating copy to clipboard operation
quickstart-nodejs copied to clipboard

how to tell on the client side that the user is logged in when using node js and react

Open naissa12 opened this issue 5 years ago • 1 comments

I used the following code (https://github.com/firebase/quickstart-nodejs/blob/master/auth-sessions/app.js) to log a user in using React and Nodejs and Firebase. I can tell if someone is logged in using NodeJs, but not on the ReactJs side. I used the code and that does not work after a few minutes:

app.auth().onAuthStateChanged((user) => {

naissa12 avatar Oct 09 '19 03:10 naissa12

Hey @naissa12, the sample code is only for server side sessions (via httpOnly cookies). Notice we set persistence to NONE

bojeil-google avatar Oct 09 '19 03:10 bojeil-google