Commit 37d6cbbe2f0ed018bcadf7fd166691ca08416434

Authored by Nicolás Guarnieri
Exists in master

Merge branch 'master' into 'master'

Master

See merge request !1
1 { 1 {
2 "name": "foca-login", 2 "name": "foca-login",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "Login", 4 "description": "Login",
5 "main": "dist/foca-login.js", 5 "main": "dist/foca-login.js",
6 "scripts": { 6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1", 7 "test": "echo \"Error: no test specified\" && exit 1",
8 "compile": "gulp compile", 8 "compile": "gulp compile",
9 "gulp-pre-commit": "gulp pre-commit", 9 "gulp-pre-commit": "gulp pre-commit",
10 "postinstall": "npm run compile && gulp clean-post-install", 10 "postinstall": "npm run compile && gulp clean-post-install",
11 "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" 11 "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular angular-route angular-cookies bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-replace jquery jshint pump && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas"
12 }, 12 },
13 "pre-commit": [ 13 "pre-commit": [
14 "gulp-pre-commit" 14 "gulp-pre-commit"
15 ], 15 ],
16 "repository": { 16 "repository": {
17 "type": "git", 17 "type": "git",
18 "url": "https://debo.suite.repo/modulos-npm/foca-login.git" 18 "url": "https://debo.suite.repo/modulos-npm/foca-login.git"
19 }, 19 },
20 "author": "Foca Software", 20 "author": "Foca Software",
21 "license": "ISC", 21 "license": "ISC",
22 "peerDependencies": { 22 "peerDependencies": {
23 "angular": "^1.7.x", 23 "angular": "^1.7.x",
24 "bootstrap": "^4.1.x", 24 "bootstrap": "^4.1.x",
25 "jquery": "^3.3.x", 25 "jquery": "^3.3.x",
26 "font-awesome": "^4.7.x", 26 "font-awesome": "^4.7.x",
27 "gulp": "^3.9.x", 27 "gulp": "^3.9.x",
28 "gulp-concat": "2.6.x", 28 "gulp-concat": "2.6.x",
29 "gulp-jshint": "^2.1.x", 29 "gulp-jshint": "^2.1.x",
30 "gulp-rename": "^1.4.x", 30 "gulp-rename": "^1.4.x",
31 "gulp-replace": "^1.0.x", 31 "gulp-replace": "^1.0.x",
32 "gulp-uglify-es": "^1.0.x", 32 "gulp-uglify-es": "^1.0.x",
33 "jshint": "^2.9.x", 33 "jshint": "^2.9.x",
34 "pump": "^3.0.x", 34 "pump": "^3.0.x",
35 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" 35 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas"
36 }, 36 },
37 "devDependencies": { 37 "devDependencies": {
38 "angular": "^1.7.5", 38 "angular": "1.7.5",
39 "angular-cookies": "^1.7.5", 39 "angular-cookies": "1.7.5",
40 "angular-route": "^1.7.5", 40 "angular-route": "1.7.5",
41 "bootstrap": "^4.1.3", 41 "bootstrap": "4.1.3",
42 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", 42 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas",
43 "font-awesome": "^4.7.0", 43 "font-awesome": "4.7.0",
44 "gulp": "^3.9.1", 44 "gulp": "3.9.1",
45 "gulp-angular-templatecache": "^2.2.2", 45 "gulp-angular-templatecache": "2.2.5",
46 "gulp-clean": "^0.4.0", 46 "gulp-clean": "0.4.0",
47 "gulp-connect": "^5.6.1", 47 "gulp-connect": "5.6.1",
48 "gulp-htmlmin": "^5.0.1", 48 "gulp-htmlmin": "5.0.1",
49 "gulp-jshint": "^2.1.0", 49 "gulp-jshint": "2.1.0",
50 "gulp-rename": "^1.4.0", 50 "gulp-rename": "1.4.0",
51 "gulp-replace": "^1.0.0", 51 "gulp-replace": "1.0.0",
52 "gulp-sequence": "^1.0.0", 52 "gulp-sequence": "1.0.0",
53 "gulp-uglify-es": "^1.0.4", 53 "gulp-uglify-es": "1.0.4",
54 "jasmine-core": "^3.2.1", 54 "jasmine-core": "3.3.0",
55 "jquery": "^3.3.1", 55 "jquery": "3.3.1",
56 "jshint": "^2.9.6", 56 "jshint": "2.9.6",
57 "pre-commit": "^1.2.2", 57 "pre-commit": "1.2.2",
58 "pump": "^3.0.0" 58 "pump": "3.0.0"
59 } 59 }
60 } 60 }
61 61
src/js/controller.js
1 angular.module('focaLogin') 1 angular.module('focaLogin')
2 .controller('focaLoginController', [ 2 .controller('focaLoginController', [
3 '$scope', 'focaLoginService', '$location', '$cookies', 3 '$scope', 'focaLoginService', '$location', '$cookies',
4 function($scope, focaLoginService, $location, $cookies) { 4 function($scope, focaLoginService, $location, $cookies) {
5 $scope.paso = 1; 5 $scope.paso = 1;
6 $scope.enviar = function() { 6 $scope.enviar = function() {
7 focaLoginService.login($scope.usuario).then(function(datos) { 7 focaLoginService.login($scope.usuario).then(function(datos) {
8 $cookies.put('idUsuario', $scope.usuario.idUsuario); 8 $cookies.put('idUsuario', $scope.usuario.idUsuario);
9 $cookies.put('token', datos.data.token); 9 $cookies.put('token', datos.data.token);
10 $location.path('/'); 10 $location.path('/');
11 $scope.$emit('blur'); 11 $scope.$emit('blur');
12 }); 12 });
13 }; 13 };
14 $scope.irPaso = function(numeroPaso) { 14 $scope.irPaso = function(numeroPaso) {
15 $scope.paso = numeroPaso; 15 $scope.paso = numeroPaso;
16 }; 16 };
17 } 17 }
18 ]) 18 ])
19 .controller('focaLogoutController', [ 19 .controller('focaLogoutController', [
20 '$cookies', '$location', 20 '$cookies', '$location',
21 function($cookies, $location) { 21 function($cookies, $location) {
22 $cookies.remove('idUsuario'); 22 $cookies.remove('idUsuario');
23 $cookies.remove('token'); 23 $cookies.remove('token');
24 //Cierra ventana
25 window.open('', '_self', ''); //bug fix
26 window.close();
24 $location.path('/login'); 27 $location.path('/login');
25 } 28 }
26 ]); 29 ]);
27 30