Pregunta

In the AngularFire-seed this happens in the run-definition:

$rootScope.auth = loginService.init('/login');

Then in loginService-definition:

init: function() {
  return auth = $firebaseSimpleLogin(firebaseRef());
},

And firebaseRef is a service that looks like this:

return function(path) {
  return new Firebase(pathRef([FBURL].concat(Array.prototype.slice.call(arguments))));
}

The FBURL is a constant:

.constant('FBURL', 'https://INSTANCE.firebaseio.com')

So for me it looks like the '/login' is the part of the path in the firebase-reference. But if so, should it not be passed on like this?

init: function(path) {
  return auth = $firebaseSimpleLogin(firebaseRef(path));
},

So the question is really: What happens with the "/login" argument on the top? For me it looks like it is "lost" in the init-function. But since this is made by the Firebase-people, I am sure there is a meaning behind it and there is something that I do not understand here...

¿Fue útil?

Solución

The /login argument is an artifact from an older version of RouteSecurity and is no longer used.

It was replaced by loginRedirectPath in config.js.

The path has no bearing on authentication in Firebase as you authenticate against the entire instance no matter what child paths you might pass in the reference to $firebaseSimpleLogin.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top