Commit 6b3f3e7da5ea5fa2a82b39c9ccf1b50d63a1e01f
1 parent
dbde30ee99
Exists in
master
and in
2 other branches
md5 antes de enviar
Showing
1 changed file
with
6 additions
and
4 deletions
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); |