Firebase Admin SDK - Current Logged In User - Nodejs

Viewed 8013

How do i get currentUser in firebase admin SDK. In client SDK we can use

onAuthStateChanged() or firebase.auth().currentUser()

In NodeJs Server.js file firebase admin SDK onAuthStateChanged() Do not work, what should work here?

Basically i want only logged in users to access my innerPages so i am using express,nodejs app.get method to create routes.

app.get('/', authenticationRequired ,function(req,res){
    res.sendFile(path.join(__dirname+'/index.html'));
});

And trying to write authenticationRequired method (returns false or true depending on if user is logged in).

1 Answers
Related