Skip to content

Instantly share code, notes, and snippets.

@keokilee
Created March 11, 2015 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keokilee/9e5642ca2338f7dd44cb to your computer and use it in GitHub Desktop.
Save keokilee/9e5642ca2338f7dd44cb to your computer and use it in GitHub Desktop.
Angular Auth Service and ES6
var Firebase = require('firebase');
module.exports = AuthService;
AuthService.$inject = ['$firebaseAuth'];
function AuthService($firebaseAuth) {
let ref = new Firebase();
var auth = $firebaseAuth(ref);
return {
isAuthenticated,
loginUser
};
function isAuthenticated(callback) {
auth.$onAuth(callback);
}
function loginUser(provider) {
return auth.$authWithOAuthPopup(provider);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment