Skip to content

Commit

Permalink
Merge pull request #46 from KoHyunsu/master
Browse files Browse the repository at this point in the history
[Edit] Apply angular-sha module to hash password
  • Loading branch information
pec9399 authored Jun 7, 2018
2 parents 3607fa7 + 1672a0b commit 53603ea
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
83 changes: 42 additions & 41 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
{
"name": "pms",
"version": "0.0.0",
"dependencies": {
"moment": "^2.18.1",
"malarkey": "yuanqing/malarkey#~1.3.1",
"animate.css": "^3.5.2",
"angular": "1.6.6",
"angular-tooltips": "^1.1.10",
"angular-bootstrap": "^2.0.0",
"angular-ui-select2": "^0.0.5",
"angular-ui-select": "^0.19.6",
"angular-ui-router-styles": "^1.1.0",
"angular-ui-router": "^1.0.5",
"angular-datatables": "^4.1.1",
"ng-file-upload": "^12.2.13",
"ngprogress": "^1.1.3",
"ng-dialog": "^1.1.0",
"oclazyload": "^1.1.0",
"angular-cookies": "^1.6.5",
"angular-sanitize": "^1.6.5",
"angular-toastr": "^2.1.1",
"angular-ui": "^0.4.0",
"angular-animate": "^1.6.5",
"angular-material": "^1.1.4",
"angular-material-icons": "^0.7.1",
"angular-material-data-table": "^0.10.10",
"ckeditor": "#full/4.7.1",
"bootstrap": "^3.2.0",
"select2": "~3.4.8",
"jquery": "^3.1.1",
"datatables": "^1.10.14",
"datatables.net": "^1.10.15",
"angular-sessionstorage": "^1.1.5",
"angular-ckeditor": "^1.0.3",
"angular-ui-select3": "ui-select#*"
},
"devDependencies": {},
"resolutions": {
"angular-ui-router": "^1.0.5",
"angular": "1.7.0"
}
"name": "pms",
"version": "0.0.0",
"dependencies": {
"moment": "^2.18.1",
"malarkey": "yuanqing/malarkey#~1.3.1",
"animate.css": "^3.5.2",
"angular": "1.6.6",
"angular-tooltips": "^1.1.10",
"angular-bootstrap": "^2.0.0",
"angular-ui-select2": "^0.0.5",
"angular-ui-select": "^0.19.6",
"angular-ui-router-styles": "^1.1.0",
"angular-ui-router": "^1.0.5",
"angular-datatables": "^4.1.1",
"ng-file-upload": "^12.2.13",
"ngprogress": "^1.1.3",
"ng-dialog": "^1.1.0",
"oclazyload": "^1.1.0",
"angular-cookies": "^1.6.5",
"angular-sanitize": "^1.6.5",
"angular-toastr": "^2.1.1",
"angular-ui": "^0.4.0",
"angular-animate": "^1.6.5",
"angular-material": "^1.1.4",
"angular-material-icons": "^0.7.1",
"angular-material-data-table": "^0.10.10",
"ckeditor": "#full/4.7.1",
"bootstrap": "^3.2.0",
"select2": "~3.4.8",
"jquery": "^3.1.1",
"datatables": "^1.10.14",
"datatables.net": "^1.10.15",
"angular-sessionstorage": "^1.1.5",
"angular-ckeditor": "^1.0.3",
"angular-ui-select3": "ui-select#*",
"angular-sha": "^0.3.3"
},
"devDependencies": {},
"resolutions": {
"angular-ui-router": "^1.0.5",
"angular": "1.7.0"
}
}
7 changes: 3 additions & 4 deletions src/app/layout/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
.controller('LoginController', LoginController);

// 로그인 컨트롤러
function LoginController($log, $window, $sessionStorage, $document, $http, $state, SHA256) {
function LoginController($log, $window, $sessionStorage, $document, $http, $state, $sha) {
const vm = this;
vm.log = $log.log;

vm.login = () => {
// 백엔드에 인증 시도
$http.post('/rest/login', {
uid: vm.uid,
pw: vm.pw
pw: $sha.hash(vm.pw)
}).then((result) => {
if (result.data.result) {
$window.location.assign('/main');
} else if (vm.uid == null) alert('아이디를 입력해주세요.');
else alert('아이디 또는 비밀번호를 다시 확인해주세요.');
console.log('Login Error');

$sessionStorage.putObject('session', result.data);
});
Expand Down Expand Up @@ -58,7 +57,7 @@
$http.post('/rest/user', {
name: vm.name,
uid: vm.uid,
pw: vm.pw,
pw: $sha.hash(vm.pw),
email: vm.email,
ph: vm.ph
});
Expand Down

0 comments on commit 53603ea

Please sign in to comment.