Skip to content

Instantly share code, notes, and snippets.

@gintsgints
Created May 16, 2014 17:23
Show Gist options
  • Select an option

  • Save gintsgints/89118fd498941083e95e to your computer and use it in GitHub Desktop.

Select an option

Save gintsgints/89118fd498941083e95e to your computer and use it in GitHub Desktop.
var authref = new Firebase(FIREBASE_URL);
$scope.auth = $firebaseSimpleLogin(authref, function(error, user) {
if (user) {
// user authenticated with Firebase
var ref = new Firebase(FIREBASE_URL + 'events/?owner=' + user.uid);
$scope.events = $firebase(ref);
} else {
// user is logged out or failed login
var ref = new Firebase(FIREBASE_URL + 'events');
$scope.events = $firebase(ref);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment