Created
March 11, 2015 21:41
-
-
Save keokilee/9e5642ca2338f7dd44cb to your computer and use it in GitHub Desktop.
Angular Auth Service and ES6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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