Commit df49048a5308826ce5699d28d92af68843278715
Exists in
master
and in
2 other branches
Merge branch 'master' into 'develop'
Master See merge request !10
Showing
1 changed file
Show diff stats
src/js/controller.js
1 | 1 | angular.module('focaLogin') |
2 | 2 | .controller('focaLoginController', [ |
3 | - '$scope', 'focaLoginService', '$location', '$cookies', 'focaModalService', | |
4 | - function($scope, focaLoginService, $location, $cookies, focaModalService) { | |
3 | + '$scope', 'focaLoginService', '$location', '$cookies', 'focaModalService', 'md5', | |
4 | + function($scope, focaLoginService, $location, $cookies, focaModalService, md5) { | |
5 | 5 | $scope.paso = 1; |
6 | 6 | $scope.enviar = function() { |
7 | - focaLoginService.login($scope.usuario).then(function(datos) { | |
8 | - | |
7 | + focaLoginService.login({ | |
8 | + idUsuario: $scope.usuario.idUsuario, | |
9 | + clave: md5.createHash($scope.usuario.clave) | |
10 | + }).then(function(datos) { | |
9 | 11 | if (datos.data.chofer && datos.data.chofer.id) { |
10 | 12 | $cookies.put('chofer', datos.data.chofer.id); |
11 | 13 | $cookies.put('nombreUsuario', datos.data.chofer.nombre); |