I have a problem when I try to create more than one instance of new Firebase(url); .
For instance:
var token1 = "c.AdASdsAsds..."; var token2 = "c.dkasdEddss..."; var v1 = new Firebase('https://developer-api.nest.com'); v1.auth(token1,function(err){ console.log("Connected 1 "+err); },function(err){ console.log("Cancel 1: "+err); }); var v2 = new Firebase('https://developer-api.nest.com'); v2.auth(token2,function(err){ console.log("Connected 2 "+err); },function(err){ console.log("Cancel 2 "+err); });
Console logs: Connected 2 null and what it is no more.
So this means that it never calls the callback function from v1.auth(); she ignores it, it looks like it is getting overridden by v2.auth(); , even if they are different instances of Firebases, and it interferes with everything else, for example, v1.child("path").on("value",function(snapshot){}); and v2.child("path").on("value",function(snapshot){}); will not work when this happens.
source share