diff --git a/DOL.WHD.Section14c.Web/src/images/correct9.png b/DOL.WHD.Section14c.Web/src/images/correct9.png new file mode 100644 index 00000000..a83160a0 Binary files /dev/null and b/DOL.WHD.Section14c.Web/src/images/correct9.png differ diff --git a/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormController.js b/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormController.js index d978a7ad..fd01a865 100644 --- a/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormController.js +++ b/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormController.js @@ -34,6 +34,8 @@ module.exports = function(ngModule) { vm.passwordsDontMatch = false; vm.passwordComplexity = false; vm.accountCreated = false; + vm.emailVerified = false; + vm.emailVerificationError = false; } vm.resetErrors(); @@ -65,6 +67,18 @@ module.exports = function(ngModule) { vm.emailVerificationUserId = $location.search().userId; vm.isEmailVerificationRequest = vm.emailVerificationCode !== undefined && vm.emailVerificationCode !== undefined + if(vm.isEmailVerificationRequest){ + $location.search('code', null); + $location.search('userId', null); + vm.resetErrors(); + apiService.emailVerification(vm.emailVerificationUserId, vm.emailVerificationCode, $scope.verifyResponse).then(function (result) { + vm.emailVerified = true; + }, function (error) { + vm.emailVerificationError = true; + console.log(error.statusText + (error.data && error.data.error ? ': ' + error.data.error + ' - ' + error.data.error_description : '')); + }); + } + $scope.onSubmitClick = function() { vm.resetErrors(); vm.registerdEmail = '' @@ -113,8 +127,6 @@ module.exports = function(ngModule) { $scope.regResponse = null; $scope.regWidgetId = null; - $scope.verifyResponse = null; - $scope.verifyWidgetId = null; $scope.model = { key: _env.reCaptchaSiteKey }; @@ -131,20 +143,6 @@ module.exports = function(ngModule) { vcRecaptchaService.reload($scope.regWidgetId); $scope.regResponse = null; }; - $scope.setVerifyResponse = function (response) { - console.info('Response available'); - $scope.verifyResponse = response; - }; - $scope.createVerifyWidget = function (widgetId) { - console.info('Created widget ID: %s', widgetId); - $scope.verifyWidgetId = widgetId; - }; - $scope.resetVerifyCaptcha = function() { - console.info('Captcha expired/reset. Resetting response object'); - vcRecaptchaService.reload($scope.verifyWidgetId); - $scope.verifyResponse = null; - }; - $scope.hideShowPassword = function(){ if ($scope.inputType === 'password') @@ -152,20 +150,5 @@ module.exports = function(ngModule) { else $scope.inputType = 'password'; }; - - $scope.onVerifyClick = function() { - $location.search('code', null); - $location.search('userId', null); - vm.resetErrors(); - apiService.emailVerification(vm.emailVerificationUserId, vm.emailVerificationCode, $scope.verifyResponse).then(function (result) { - //TODO: show success - $location.path("/"); - }, function (error) { - console.log(error.statusText + (error.data && error.data.error ? ': ' + error.data.error + ' - ' + error.data.error_description : '')); - //vcRecaptchaService.reload($scope.widgetId); - $location.path("/"); - }); - } - }); } diff --git a/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormTemplate.html b/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormTemplate.html index 550687c4..94882dcb 100644 --- a/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormTemplate.html +++ b/DOL.WHD.Section14c.Web/src/modules/components/userRegistrationForm/userRegistrationFormTemplate.html @@ -9,8 +9,6 @@

Read our FAQs for Electronic Section 14(c) Certificate Application


- -
+
-
-

Verify Email

-
-
-
+
+ -{{accountCreated}} \ No newline at end of file + +
\ No newline at end of file