Monday, 15 May 2017

Nodejs Firebase and Angular4 Authentication

I have a client application, written in angular4 which communicates with a firebase server. Currently I'm trying to integrate a nodejs with firebase in a way that it will communicate with client app as well.

I have setup a fire-admin configs:

var admin = require("firebase-admin");

var serviceAccount = require("./server/myfile.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://mydb.firebaseio.com"
});

and able to retrieve a data like this:

  var db = admin.database();
  var ref = db.ref("messages");

  ref.once("value", function(snapshot) {
    console.log(snapshot.val());
  });

But how can I check in NodeJS server whether user in client app has logged in ? I need this NodeJS server to communicate with client and provide data and files if neccessary.



via d123546

No comments:

Post a Comment