Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.