Skip to content

Instantly share code, notes, and snippets.

@veer66
Created September 23, 2013 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veer66/6676101 to your computer and use it in GitHub Desktop.
Save veer66/6676101 to your computer and use it in GitHub Desktop.
Login controller for angular-http-auth that send ignoreAuthModule = true
'use scrict';
angular.module('mod1')
.controller('LoginCtrl', function($scope, $http, authService) {
$http.defaults.withCredentials = true;
$scope.submit = function() {
$scope.login_status = "Logging in";
loginInfo = {username: $scope.username, password: $scope.password}
$http({ignoreAuthModule: true, method: "POST", url: "/user/login", data:loginInfo})
.success(function(data, status, header) {
authService.loginConfirmed();
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment