Skip to content

Instantly share code, notes, and snippets.

@AndriyShepitsen
Created August 27, 2014 20:48
Show Gist options
  • Save AndriyShepitsen/5635cd567033e9413607 to your computer and use it in GitHub Desktop.
Save AndriyShepitsen/5635cd567033e9413607 to your computer and use it in GitHub Desktop.
login
$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