From cf2b3498372e8b4b739d8723aa084b756fea661b Mon Sep 17 00:00:00 2001 From: Rishav Date: Mon, 3 Apr 2017 18:07:29 +0530 Subject: [PATCH] login authenticate flow --- app/views/login/login.controller.js | 20 +++----------------- app/views/login/login.html | 8 ++++---- app/views/login/login.service.js | 31 ++++++++++++++++++++++++++----- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/app/views/login/login.controller.js b/app/views/login/login.controller.js index 7b5ed45..1f92c3d 100644 --- a/app/views/login/login.controller.js +++ b/app/views/login/login.controller.js @@ -10,23 +10,9 @@ var loginData = "username=" + $scope.user.username + "&password=" + $scope.user.password; LoginService.loginUser(loginData).then(function(result) { - console.log(result) - $state.go('index.dashboard'); - //$state.go('index.dashboard'); - // if(typeof result == 'object') { - // // LoginService.authenticate(); - // // LoginService.setAuth(true); - // // $rootScope.path = true; - // $state.go('index.dashboard'); - // // var reqPwdChng = localStorage.getItem("requiredChangePwd"); - // // if (reqPwdChng && reqPwdChng == "Y") { - // // $state.go('resetPassword'); - // // } else { - // // $state.go('app.upload'); - // // } - // } else { - // //toastr.info("Error in login. Please check login name and password"); - // } + LoginService.authenticate(); + LoginService.setAuth(true); + }) } diff --git a/app/views/login/login.html b/app/views/login/login.html index 1fcb666..198fc14 100644 --- a/app/views/login/login.html +++ b/app/views/login/login.html @@ -7,14 +7,14 @@

Login in. To see it in action.

-
+
- +
- +
- +