Created
August 27, 2014 20:48
-
-
Save AndriyShepitsen/5635cd567033e9413607 to your computer and use it in GitHub Desktop.
login
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
$scope.fenLogin = function (email, pass) { | |
if (_.isEmpty(email) || _.isEmpty(pass)) { | |
$scope.loginError = true; | |
return; | |
} | |
var mainRef = new Firebase(url); | |
var auth = $firebaseSimpleLogin(mainRef); | |
auth.$login('password', { | |
email: email, | |
password: pass | |
}).then(function (user) { | |
$state.go('admin'); | |
$scope.loginError = false; | |
}, function () { | |
$scope.loginError = true; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment