Commit b3e7d5cbe6b2e1c05b2467f320dad1444d00d60f
1 parent
e437a880
Exists in
master
and in
8 other branches
Sync
Showing
5 changed files
with
165 additions
and
96 deletions
Show diff stats
src/app/components/auth/auth.service.js
| @@ -8,10 +8,10 @@ | @@ -8,10 +8,10 @@ | ||
| 8 | .factory('AuthInterceptor', AuthInterceptor); | 8 | .factory('AuthInterceptor', AuthInterceptor); |
| 9 | 9 | ||
| 10 | /** @ngInject */ | 10 | /** @ngInject */ |
| 11 | - function AuthService($http, $rootScope, Session, AUTH_EVENTS, API, $log) { | 11 | + function AuthService($q, $http, $rootScope, Session, AUTH_EVENTS, API, PATH, $log) { |
| 12 | 12 | ||
| 13 | function register (data){ | 13 | function register (data){ |
| 14 | - var url = API.host + '/api/v1/register'; | 14 | + var url = PATH.host + '/api/v1/register'; |
| 15 | $log.debug('data', data); | 15 | $log.debug('data', data); |
| 16 | // var encodedData = data; | 16 | // var encodedData = data; |
| 17 | var encodedData = ''; | 17 | var encodedData = ''; |
| @@ -22,6 +22,8 @@ | @@ -22,6 +22,8 @@ | ||
| 22 | encodedData += '&password=' + data.password; | 22 | encodedData += '&password=' + data.password; |
| 23 | encodedData += '&password_confirmation=' + data.password_confirmation; | 23 | encodedData += '&password_confirmation=' + data.password_confirmation; |
| 24 | encodedData += '&user_terms_accepted=' + data.user_terms_accepted; | 24 | encodedData += '&user_terms_accepted=' + data.user_terms_accepted; |
| 25 | + encodedData += '&captcha_text=' + data.captcha_text; | ||
| 26 | + encodedData += '&txtToken_captcha_serpro_gov_br=' + data.txtToken_captcha_serpro_gov_br; | ||
| 25 | 27 | ||
| 26 | // var encodedData = _encodeObj(data); | 28 | // var encodedData = _encodeObj(data); |
| 27 | // var encodedData = angular.element.param(data); | 29 | // var encodedData = angular.element.param(data); |
| @@ -44,8 +46,8 @@ | @@ -44,8 +46,8 @@ | ||
| 44 | }, function(response) { | 46 | }, function(response) { |
| 45 | $log.debug('AuthService.register [FAIL] response', response); | 47 | $log.debug('AuthService.register [FAIL] response', response); |
| 46 | 48 | ||
| 47 | - $rootScope.$broadcast(AUTH_EVENTS.registerFailed); | ||
| 48 | - return response; | 49 | + $rootScope.$broadcast(AUTH_EVENTS.registerFailed, response); |
| 50 | + return $q.reject(response); | ||
| 49 | }); | 51 | }); |
| 50 | } | 52 | } |
| 51 | 53 |
src/app/index.run.js
| @@ -4,12 +4,13 @@ | @@ -4,12 +4,13 @@ | ||
| 4 | 4 | ||
| 5 | angular | 5 | angular |
| 6 | .module('dialoga') | 6 | .module('dialoga') |
| 7 | - .run(runAuth) | ||
| 8 | - .run(runSocialAuth) | ||
| 9 | .run(runAccessibility) | 7 | .run(runAccessibility) |
| 8 | + .run(runAuth) | ||
| 9 | + .run(runCaptcha) | ||
| 10 | + .run(runColorUtils) | ||
| 10 | .run(runHistory) | 11 | .run(runHistory) |
| 11 | .run(runPath) | 12 | .run(runPath) |
| 12 | - .run(runColorUtils) | 13 | + .run(runSocialAuth) |
| 13 | .run(runUtils) | 14 | .run(runUtils) |
| 14 | .run(runBlock); | 15 | .run(runBlock); |
| 15 | 16 | ||
| @@ -45,18 +46,53 @@ | @@ -45,18 +46,53 @@ | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | /** @ngInject */ | 48 | /** @ngInject */ |
| 49 | + function runCaptcha($window, $log, GUID) { | ||
| 50 | + var serpro_captcha_clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | ||
| 51 | + | ||
| 52 | + $window.initCaptcha = function(element) { | ||
| 53 | + var $element = angular.element(element); | ||
| 54 | + | ||
| 55 | + // already have a started captcha | ||
| 56 | + if ($element.data('captcha')) { | ||
| 57 | + $log.info('Captcha already initialized. Abort.'); | ||
| 58 | + return; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + // Create a new instance of Captcha | ||
| 62 | + var oCaptcha_serpro_gov_br = new $window.captcha_serpro_gov_br(); | ||
| 63 | + | ||
| 64 | + // Set the initial data | ||
| 65 | + $element.val(''); | ||
| 66 | + $element.data('captcha', oCaptcha_serpro_gov_br); | ||
| 67 | + oCaptcha_serpro_gov_br.clienteId = serpro_captcha_clienteId; | ||
| 68 | + // oCaptcha_serpro_gov_br.url = "/serprocaptcha"; | ||
| 69 | + oCaptcha_serpro_gov_br.criarUI(element, 'css', 'serpro_captcha_component_', GUID.generate()); | ||
| 70 | + }; | ||
| 71 | + | ||
| 72 | + $window.reloadCaptcha = function(element) { | ||
| 73 | + var $element = angular.element(element); | ||
| 74 | + | ||
| 75 | + if ($element.data('captcha')) { | ||
| 76 | + $element.data('captcha').recarregar(); | ||
| 77 | + } | ||
| 78 | + }; | ||
| 79 | + | ||
| 80 | + $log.debug('runCaptcha'); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + /** @ngInject */ | ||
| 48 | function runSocialAuth($window, $rootScope, $interval, $log) { | 84 | function runSocialAuth($window, $rootScope, $interval, $log) { |
| 49 | 85 | ||
| 50 | - $window.oauthClientAction = function (url){ | 86 | + $window.oauthClientAction = function(url) { |
| 51 | var child = $window.open(url, '_blank'); | 87 | var child = $window.open(url, '_blank'); |
| 52 | var interval = $interval(function() { | 88 | var interval = $interval(function() { |
| 53 | try { | 89 | try { |
| 54 | - if(!child.closed) { | 90 | + if (!child.closed) { |
| 55 | child.postMessage({ | 91 | child.postMessage({ |
| 56 | message: 'requestOauthClientPluginResult' | 92 | message: 'requestOauthClientPluginResult' |
| 57 | }, '*'); | 93 | }, '*'); |
| 58 | } | 94 | } |
| 59 | - } catch(e) { | 95 | + } catch (e) { |
| 60 | // we're here when the child window has been navigated away or closed | 96 | // we're here when the child window has been navigated away or closed |
| 61 | if (child.closed) { | 97 | if (child.closed) { |
| 62 | $interval.cancel(interval); | 98 | $interval.cancel(interval); |
| @@ -118,7 +154,7 @@ | @@ -118,7 +154,7 @@ | ||
| 118 | // prevent skip link from redirecting | 154 | // prevent skip link from redirecting |
| 119 | if ($event) { $event.preventDefault(); } | 155 | if ($event) { $event.preventDefault(); } |
| 120 | 156 | ||
| 121 | - if(angular.isString(target)){ | 157 | + if (angular.isString(target)) { |
| 122 | target = angular.element(target); | 158 | target = angular.element(target); |
| 123 | } | 159 | } |
| 124 | 160 | ||
| @@ -137,7 +173,7 @@ | @@ -137,7 +173,7 @@ | ||
| 137 | $rootScope.$previousState.splice(-MAX_HISTORY, MAX_HISTORY); | 173 | $rootScope.$previousState.splice(-MAX_HISTORY, MAX_HISTORY); |
| 138 | }); | 174 | }); |
| 139 | 175 | ||
| 140 | - $rootScope.goBack = $rootScope.goBack || function () { | 176 | + $rootScope.goBack = $rootScope.goBack || function() { |
| 141 | return $rootScope.$previousState.pop(); | 177 | return $rootScope.$previousState.pop(); |
| 142 | }; | 178 | }; |
| 143 | } | 179 | } |
| @@ -178,7 +214,7 @@ | @@ -178,7 +214,7 @@ | ||
| 178 | 214 | ||
| 179 | /** @ngInject */ | 215 | /** @ngInject */ |
| 180 | function runUtils($rootScope) { | 216 | function runUtils($rootScope) { |
| 181 | - $rootScope.stripHtml = function (text) { | 217 | + $rootScope.stripHtml = function(text) { |
| 182 | return String(text).replace(/<[^>]+>/gm, ''); | 218 | return String(text).replace(/<[^>]+>/gm, ''); |
| 183 | }; | 219 | }; |
| 184 | } | 220 | } |
src/app/pages/auth/auth.controller.js
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | .controller('AuthPageController', AuthPageController); | 6 | .controller('AuthPageController', AuthPageController); |
| 7 | 7 | ||
| 8 | /** @ngInject */ | 8 | /** @ngInject */ |
| 9 | - function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { | 9 | + function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, $interval, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { |
| 10 | var vm = this; | 10 | var vm = this; |
| 11 | 11 | ||
| 12 | vm.$scope = $scope; | 12 | vm.$scope = $scope; |
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | vm.$location = $location; | 15 | vm.$location = $location; |
| 16 | vm.$state = $state; | 16 | vm.$state = $state; |
| 17 | vm.$timeout = $timeout; | 17 | vm.$timeout = $timeout; |
| 18 | + vm.$interval = $interval; | ||
| 18 | vm.AUTH_EVENTS = AUTH_EVENTS; | 19 | vm.AUTH_EVENTS = AUTH_EVENTS; |
| 19 | vm.AuthService = AuthService; | 20 | vm.AuthService = AuthService; |
| 20 | vm.DialogaService = DialogaService; | 21 | vm.DialogaService = DialogaService; |
| @@ -78,14 +79,38 @@ | @@ -78,14 +79,38 @@ | ||
| 78 | AuthPageController.prototype.attachListeners = function() { | 79 | AuthPageController.prototype.attachListeners = function() { |
| 79 | var vm = this; | 80 | var vm = this; |
| 80 | 81 | ||
| 82 | + vm.$scope.$on(vm.AUTH_EVENTS.registerSuccess, function(event, response) { | ||
| 83 | + vm.$log.debug('TODO: handle register success'); | ||
| 84 | + vm.$log.debug('[register success] response', response); | ||
| 85 | + }); | ||
| 86 | + | ||
| 87 | + vm.$scope.$on(vm.AUTH_EVENTS.registerFailed, function(event, response) { | ||
| 88 | + vm.$log.debug('TODO: handle register error'); | ||
| 89 | + vm.$log.debug('[register error] response', response); | ||
| 90 | + | ||
| 91 | + var reason = response.data.message; | ||
| 92 | + vm.errorMessage = reason; | ||
| 93 | + }); | ||
| 94 | + | ||
| 81 | vm.$scope.$on('oauthClientPluginResult', function(event, response) { | 95 | vm.$scope.$on('oauthClientPluginResult', function(event, response) { |
| 82 | vm.$log.debug('response', response); | 96 | vm.$log.debug('response', response); |
| 83 | 97 | ||
| 84 | // var logged_id = response.data.logged_id; | 98 | // var logged_id = response.data.logged_id; |
| 85 | // var private_token = response.data.private_token; | 99 | // var private_token = response.data.private_token; |
| 86 | // var user = response.data.user; | 100 | // var user = response.data.user; |
| 87 | - | ||
| 88 | }); | 101 | }); |
| 102 | + | ||
| 103 | + var stop = null; | ||
| 104 | + stop = vm.$interval(function(){ | ||
| 105 | + var $el = angular.element('#serpro_captcha'); | ||
| 106 | + | ||
| 107 | + if ($el && $el.length > 0 ){ | ||
| 108 | + vm.$window.initCaptcha($el[0]); | ||
| 109 | + vm.$interval.cancel(stop); | ||
| 110 | + stop = undefined; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + }, 200); | ||
| 89 | }; | 114 | }; |
| 90 | 115 | ||
| 91 | AuthPageController.prototype.onClickLogout = function() { | 116 | AuthPageController.prototype.onClickLogout = function() { |
| @@ -94,7 +119,7 @@ | @@ -94,7 +119,7 @@ | ||
| 94 | vm.AuthService.logout(); | 119 | vm.AuthService.logout(); |
| 95 | }; | 120 | }; |
| 96 | 121 | ||
| 97 | - AuthPageController.prototype.submitSigup = function(credentials) { | 122 | + AuthPageController.prototype.submitSingup = function(credentials) { |
| 98 | var vm = this; | 123 | var vm = this; |
| 99 | 124 | ||
| 100 | vm.AuthService.register(credentials).then(function(response) { | 125 | vm.AuthService.register(credentials).then(function(response) { |
| @@ -108,8 +133,19 @@ | @@ -108,8 +133,19 @@ | ||
| 108 | }, function(response) { | 133 | }, function(response) { |
| 109 | vm.$log.debug('register error.response', response); | 134 | vm.$log.debug('register error.response', response); |
| 110 | 135 | ||
| 136 | + var message = response.data.message; | ||
| 137 | + vm.errorMessage = message; | ||
| 138 | + | ||
| 139 | + if(response.data.code === 500){ | ||
| 140 | + vm.internalError = true; | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + | ||
| 111 | // TODO: mensagens de erro | 144 | // TODO: mensagens de erro |
| 112 | // TODO: tratar multiplos erros | 145 | // TODO: tratar multiplos erros |
| 146 | + | ||
| 147 | + // javascript_console_message: "Unable to reach Serpro's Captcha validation service" | ||
| 148 | + // message: "Internal captcha validation error" | ||
| 113 | }); | 149 | }); |
| 114 | }; | 150 | }; |
| 115 | 151 | ||
| @@ -137,15 +173,14 @@ | @@ -137,15 +173,14 @@ | ||
| 137 | 173 | ||
| 138 | // start countdown | 174 | // start countdown |
| 139 | vm.countdown = vm.delay; | 175 | vm.countdown = vm.delay; |
| 140 | - (function countdown() { | ||
| 141 | - vm.$timeout(function() { | ||
| 142 | - vm.countdown--; | ||
| 143 | - vm.$log.debug('vm.countdown', vm.countdown); | ||
| 144 | - if (vm.countdown > 0) { | ||
| 145 | - countdown(); | ||
| 146 | - } | ||
| 147 | - }, 1000); | ||
| 148 | - })(); | 176 | + var stop = null; |
| 177 | + stop = vm.$interval(function() { | ||
| 178 | + vm.countdown--; | ||
| 179 | + if (vm.countdown <= 0) { | ||
| 180 | + vm.$interval.cancel(stop); | ||
| 181 | + stop = undefined; | ||
| 182 | + } | ||
| 183 | + }, 1000); | ||
| 149 | 184 | ||
| 150 | vm.$timeout(function() { | 185 | vm.$timeout(function() { |
| 151 | var state = vm.params.state; | 186 | var state = vm.params.state; |
src/app/pages/auth/signin.html
| @@ -82,92 +82,87 @@ | @@ -82,92 +82,87 @@ | ||
| 82 | </p> | 82 | </p> |
| 83 | </div> | 83 | </div> |
| 84 | </div> | 84 | </div> |
| 85 | - <div class="row"> | ||
| 86 | - <div class="col-xs-6"> | ||
| 87 | - <button type="button" ng-click="pageSignin.authWithFacebook()" class="btn btn-lg btn-block btn-social btn-facebook"> | ||
| 88 | - <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-facebook"> | ||
| 89 | - <span class="icon icon-social-facebook"></span> | ||
| 90 | - </span> | ||
| 91 | - <span class="text">Entrar com Facebook</span> | ||
| 92 | - </button> | ||
| 93 | - </div> | ||
| 94 | - <div class="col-xs-6"> | ||
| 95 | - <button type="button" ng-click="pageSignin.authWithGooglePlus()" class="btn btn-lg btn-block btn-social btn-google-plus"> | ||
| 96 | - <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-googleplus"> | ||
| 97 | - <span class="icon icon-social-googleplus"></span> | ||
| 98 | - </span> | ||
| 99 | - <span class="text">Entrar com Google+</span> | ||
| 100 | - </button> | 85 | + <div class="row" ng-if="pageSignin.errorMessage"> |
| 86 | + <div class="col-sm-12"> | ||
| 87 | + <div class="alert alert-danger"> | ||
| 88 | + {{pageSignin.errorMessage}} | ||
| 89 | + </div> | ||
| 90 | + <div ng-if="vm.internalError"> | ||
| 91 | + <p>Este erro parece ser um problema interno.<br/>Por favor, tente novamente mais tarde.</p> | ||
| 92 | + <p>Caso o problema persista, entre em contato!</p> | ||
| 93 | + <p><a ui-sref="duvidas">Ir para página de contato</a></p> | ||
| 94 | + </div> | ||
| 101 | </div> | 95 | </div> |
| 102 | </div> | 96 | </div> |
| 103 | <div class="row"> | 97 | <div class="row"> |
| 104 | <div class="col-sm-12"> | 98 | <div class="col-sm-12"> |
| 105 | - <hr class="separator separator-cadastro"></hr> | ||
| 106 | - </div> | ||
| 107 | - <div class="row"> | ||
| 108 | - <div class="col-sm-12"> | ||
| 109 | - <form name="signupForm" ng-submit="pageSignin.submitSigup(pageSignin.signup)"> | ||
| 110 | - <div class="form-group"> | ||
| 111 | - <label for="signup-form--name">Nome*:</label> | ||
| 112 | - <span class="pull-right">*Dados obrigatórios</span> | ||
| 113 | - <input type="text" id="signup-form--name" name="name" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.name.$invalid && signupForm.name.$touched }" ng-model="pageSignin.signup.name" ng-minlength="" ng-maxlength="" required> | ||
| 114 | - <validation-messages field="signupForm.name"/> | ||
| 115 | - </div> | ||
| 116 | - <div class="form-group"> | ||
| 117 | - <label for="signup-form--email">E-mail*:</label> | ||
| 118 | - <input type="email" id="signup-form--email" name="email" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.email.$invalid && signupForm.email.$touched }" ng-model="pageSignin.signup.email" ng-minlength="" ng-maxlength="" required> | ||
| 119 | - <validation-messages field="signupForm.email"/> | 99 | + <form name="signupForm" ng-submit="pageSignin.submitSigup(pageSignin.signup)"> |
| 100 | + <div class="form-group"> | ||
| 101 | + <label for="signup-form--name">Nome*:</label> | ||
| 102 | + <span class="pull-right">*Dados obrigatórios</span> | ||
| 103 | + <input type="text" id="signup-form--name" name="name" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.name.$invalid && signupForm.name.$touched }" ng-model="pageSignin.signup.name" ng-minlength="" ng-maxlength="" required> | ||
| 104 | + <validation-messages field="signupForm.name"/> | ||
| 105 | + </div> | ||
| 106 | + <div class="form-group"> | ||
| 107 | + <label for="signup-form--email">E-mail*:</label> | ||
| 108 | + <input type="email" id="signup-form--email" name="email" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.email.$invalid && signupForm.email.$touched }" ng-model="pageSignin.signup.email" ng-minlength="" ng-maxlength="" required> | ||
| 109 | + <validation-messages field="signupForm.email"/> | ||
| 110 | + </div> | ||
| 111 | + <div class="row"> | ||
| 112 | + <div class="col-sm-6"> | ||
| 113 | + <div class="form-group"> | ||
| 114 | + <label for="signup-form--password">Senha*:</label> | ||
| 115 | + <input type="password" id="signup-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password.$invalid && signupForm.password.$touched }" ng-model="pageSignin.signup.password" ng-minlength="" ng-maxlength="" required> | ||
| 116 | + <validation-messages field="signupForm.password"/> | ||
| 117 | + </div> | ||
| 120 | </div> | 118 | </div> |
| 121 | - <div class="row"> | ||
| 122 | - <div class="col-sm-6"> | ||
| 123 | - <div class="form-group"> | ||
| 124 | - <label for="signup-form--password">Senha*:</label> | ||
| 125 | - <input type="password" id="signup-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password.$invalid && signupForm.password.$touched }" ng-model="pageSignin.signup.password" ng-minlength="" ng-maxlength="" required> | ||
| 126 | - <validation-messages field="signupForm.password"/> | ||
| 127 | - </div> | 119 | + <div class="col-sm-6"> |
| 120 | + <div class="form-group"> | ||
| 121 | + <label for="signup-form--password-confirmation">Confirmar Senha*:</label> | ||
| 122 | + <input type="password" id="signup-form--password-confirmation" name="password_confirmation" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password_confirmation.$invalid && signupForm.password_confirmation.$touched }" ng-model="pageSignin.signup.password_confirmation" ng-minlength="" ng-maxlength="" required> | ||
| 123 | + <validation-messages field="signupForm.password_confirmation"/> | ||
| 128 | </div> | 124 | </div> |
| 129 | - <div class="col-sm-6"> | ||
| 130 | - <div class="form-group"> | ||
| 131 | - <label for="signup-form--password-confirmation">Confirmar Senha*:</label> | ||
| 132 | - <input type="password" id="signup-form--password-confirmation" name="password_confirmation" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password_confirmation.$invalid && signupForm.password_confirmation.$touched }" ng-model="pageSignin.signup.password_confirmation" ng-minlength="" ng-maxlength="" required> | ||
| 133 | - <validation-messages field="signupForm.password_confirmation"/> | ||
| 134 | - </div> | 125 | + </div> |
| 126 | + </div> | ||
| 127 | + <div class="row"> | ||
| 128 | + <div class="col-sm-12" ng-show="(signupForm.password.$viewValue.length > 0 && signupForm.password_confirmation.$viewValue.length > 0) && (signupForm.password.$viewValue !== signupForm.password_confirmation.$viewValue)"> | ||
| 129 | + <div class="error-message"> | ||
| 130 | + As senhas estão diferentes. | ||
| 135 | </div> | 131 | </div> |
| 136 | </div> | 132 | </div> |
| 137 | - <div class="row"> | ||
| 138 | - <div class="col-sm-12" ng-show="(signupForm.password.$viewValue.length > 0 && signupForm.password_confirmation.$viewValue.length > 0) && (signupForm.password.$viewValue !== signupForm.password_confirmation.$viewValue)"> | 133 | + <div class="col-sm-12"> |
| 134 | + <span class="text" ng-show="signupForm.password.$viewValue.length > 0 && signupForm.password.$viewValue.length < 6"> | ||
| 139 | <div class="error-message"> | 135 | <div class="error-message"> |
| 140 | - As senhas estão diferentes. | 136 | + A senha deve ter 6 ou mais caracteres e conter números e letras. |
| 141 | </div> | 137 | </div> |
| 142 | - </div> | ||
| 143 | - <div class="col-sm-12"> | ||
| 144 | - <span class="text" ng-show="signupForm.password.$viewValue.length > 0 && signupForm.password.$viewValue.length < 6"> | ||
| 145 | - <div class="error-message"> | ||
| 146 | - A senha deve ter 6 ou mais caracteres e conter números e letras. | ||
| 147 | - </div> | ||
| 148 | - </span> | ||
| 149 | - </div> | 138 | + </span> |
| 150 | </div> | 139 | </div> |
| 151 | - <div class="form-group"> | ||
| 152 | - <div class="checkbox"> | ||
| 153 | - <label for="user_terms_accepted"> | ||
| 154 | - <input type="checkbox" id="user_terms_accepted" name="user_terms_accepted" value="aceito" ng-model="pageSignin.signup.user_terms_accepted" required> | ||
| 155 | - Já li e concordo com os | ||
| 156 | - <button type="button" class="btn btn-link" style="padding:0 0 4px 0;" data-toggle="modal" data-target="#modalTermosDeUso">Termos de Uso</button> | ||
| 157 | - </label> | ||
| 158 | - </div> | ||
| 159 | - </input> | ||
| 160 | - <validation-messages field="signupForm.user_terms_accepted"/> | ||
| 161 | </div> | 140 | </div> |
| 162 | <div class="form-group"> | 141 | <div class="form-group"> |
| 163 | - <span>Digite o texto da imagem</span> | ||
| 164 | - <p>O Captcha vai aqui</p> | 142 | + <div class="checkbox"> |
| 143 | + <label for="user_terms_accepted"> | ||
| 144 | + <input type="checkbox" id="user_terms_accepted" name="user_terms_accepted" value="aceito" ng-model="pageSignin.signup.user_terms_accepted" required> | ||
| 145 | + Já li e concordo com os | ||
| 146 | + <button type="button" class="btn btn-link" style="padding:0 0 4px 0;" data-toggle="modal" data-target="#modalTermosDeUso">Termos de Uso</button> | ||
| 147 | + </label> | ||
| 148 | + </div> | ||
| 149 | + </input> | ||
| 150 | + <validation-messages field="signupForm.user_terms_accepted"/> | ||
| 151 | + </div> | ||
| 152 | + <div class="form-group"> | ||
| 153 | + <div id="serpro_captcha" class="captcha"> | ||
| 165 | </div> | 154 | </div> |
| 166 | - <div class="form-group"> | ||
| 167 | - <button class="btn btn-lg btn-block btn-submit" ng-class=" {'disabled' : !pageSignin.signup.user_terms_accepted }" type="submit">Cadastrar</button> | 155 | + <div class="captcha"> |
| 156 | + Digite os caracteres acima: | ||
| 168 | </div> | 157 | </div> |
| 169 | - </form> | ||
| 170 | - </div> | 158 | + <div class="captcha"> |
| 159 | + <input type="text" name="captcha_text" id="captcha_text" aria-label="Escreva os caracteres do captcha aqui" ng-model="pageSignin.signup.captcha_text"> | ||
| 160 | + </div> | ||
| 161 | + </div> | ||
| 162 | + <div class="form-group"> | ||
| 163 | + <button class="btn btn-lg btn-block btn-submit" ng-class=" {'disabled' : !pageSignin.signup.user_terms_accepted }" type="submit">Cadastrar</button> | ||
| 164 | + </div> | ||
| 165 | + </form> | ||
| 171 | </div> | 166 | </div> |
| 172 | </div> | 167 | </div> |
| 173 | </div> | 168 | </div> |
src/index.html
| @@ -59,5 +59,6 @@ | @@ -59,5 +59,6 @@ | ||
| 59 | <!-- endinject --> | 59 | <!-- endinject --> |
| 60 | <!-- endbuild --> | 60 | <!-- endbuild --> |
| 61 | <script defer="defer" src="http://barra.brasil.gov.br/barra.js" type="text/javascript"></script> | 61 | <script defer="defer" src="http://barra.brasil.gov.br/barra.js" type="text/javascript"></script> |
| 62 | + <script defer="defer" src="http://captcha2.servicoscorporativos.serpro.gov.br/js/captcha.serpro.gov.br.js"></script> | ||
| 62 | </body> | 63 | </body> |
| 63 | </html> | 64 | </html> |