Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Created September 12, 2016 16:23
Show Gist options
  • Save unicodeveloper/002e43117a838cea10e43c015710fea2 to your computer and use it in GitHub Desktop.
Save unicodeveloper/002e43117a838cea10e43c015710fea2 to your computer and use it in GitHub Desktop.
Cloudinary Blog Post - Part 1
app.controller('AuthController', ['$scope','$location','$auth','toastr', function($scope, $location, $auth, toastr) {
$scope.login = function() {
$auth.login($scope.user)
.then(function() {
toastr.success('You have successfully signed in!');
$location.path('/');
})
.catch(function(error) {
toastr.error(error.data.message, error.status);
});
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment