diff options
Diffstat (limited to 'client/js/controllers/login.js')
| -rw-r--r-- | client/js/controllers/login.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js index 751bd09..e9308b8 100644 --- a/client/js/controllers/login.js +++ b/client/js/controllers/login.js @@ -7,7 +7,7 @@ * @param {sharedProfile} sharedProfile The sharedProfile service */ -mainApp.controller('loginCtrl', ['$scope','$sce','$http', 'sharedProfile', function ($scope,$sce, $http, sharedProfile) +mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$sce, Identity) { // Define default states $('#loginModal').modal({backdrop: 'static', keyboard: false}); @@ -24,23 +24,23 @@ mainApp.controller('loginCtrl', ['$scope','$sce','$http', 'sharedProfile', funct var password=$("#loginFormPassword").val(); var projectname=$("#loginFormProjectname").val(); - var result=identity.request.login($http,username, password, projectname); + var result=Identity.login(username, password, projectname); result.then(function (response){ // Parser result - var requestResultObject=identity.requestParser.parseLoginAnswer(response); + var requestResultObject=Identity.parseLoginAnswer(response); // Check for error if(requestResultObject.status!==0){ - //alert(result.data) + $('#failedToLoginAlert').show(); } else { - $('#loginModal').modal('hide'); - sharedProfile.username=username; - sharedProfile.projectname=projectname; - + $('#loginModal').modal('hide'); + Identity.profile.username=username; + Identity.profile.projectname=projectname; + } // Reset button state |
