From 7e4089427bedbc7551afeb5d3a2df09e16815553 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Mon, 28 Sep 2015 13:26:47 -0300 Subject: [PATCH] Fixing register --- www/js/controllers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/js/controllers.js b/www/js/controllers.js index 730a04b..ee8d85d 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -199,12 +199,12 @@ angular.module('confjuvapp.controllers', []) $scope.data = {}; $scope.setLoginBasedOnEmail = function() { - if (!$scope.profile.login && $scope.profile.email) $scope.profile.login = ConfJuvAppUtils.normalizeLogin($scope.profile.email); + // if (!$scope.profile.login && $scope.profile.email) $scope.profile.login = ConfJuvAppUtils.normalizeLogin($scope.profile.email); }; // Function to register $scope.Register = function(data) { - if (!data || !data.login || !data.email || !data.password || !data.password_confirmation) { + if (!data || !data.email || !data.password || !data.password_confirmation) { $ionicPopup.alert({ title: 'Registrar', template: 'Por favor preencha todos os campos' }); return; } @@ -212,7 +212,7 @@ angular.module('confjuvapp.controllers', []) $ionicPopup.alert({ title: 'Registrar', template: 'Senhas não conferem' }); return; } - + $scope.loading = true; var config = { @@ -223,7 +223,7 @@ angular.module('confjuvapp.controllers', []) } var params = { 'email': data.email, - 'login': data.login, + 'login': data.login || ConfJuvAppUtils.normalizeLogin(data.email), 'password': data.password, 'password_confirmation': data.password_confirmation, 'tipo': $scope.registerFormType, -- libgit2 0.21.2