https://support.mygoldcare.com/App/Components/Account/Registration…?e731a0ca8ef43bc225a0c7eb7eda025b
1app.controller('registrationController', ['$scope', '$http', '$rootScope', '$timeout', '$state', '$location', '$stateParams', 'registrationService', function ($scope, $http, $rootScope, $timeout, $state, $location, $stateParams, registrationService) { 2 $scope.regPattern = /^(?=.*[a-z])(?=.*\d)(?=.*[A-Z]).+$/; 3 $scope.foundUser = false; 4 $scope.user = { deliveryMode: 'magic_link' }; 5 6 if ($rootScope.settings != undefined) { 7 $scope.requestAccess = true; 8 } 9 10 $scope.submitForm = function (userRegistrationInfo) { 11 registrationService.registerUser(userRegistrationInfo, function (data) { 12 if (data && data.requiresVerification) { 13 $scope.message = data.message; 14 $scope.displayMessage = true; 15 16 if (data.deliveryMode === 'otp') { 17 setTimeout(function () { 18 $state.go('basic.verifysignup', { userid: data.userID, token: '' }); 19 }, 3000); 20 } 21 22 return; 23 } 24 25 $scope.message = data; 26 $scope.displayMessage = true; 27 setTimeout(function () { 28 $state.go('basic.login.user'); 29 }, 3000); 30 }); 31 }; 32 33 $scope.signupVerify = { 34 userID: $stateParams.userid, 35 token: $stateParams.token 36 }; 37 $scope.stateParamsToken = $stateParams.token; 38 39 $scope.submitSignupVerify = function (model) { 40 $scope.verifyError = ''; 41 42 registrationService.completeSignupVerification(model.userID, model.token, function (data, isError) { 43 if (isError) { 44 $scope.verifyError = "That verification link or code is invalid or has expired."; 45 return; 46 } 47 48 $rootScope.UserInfo = data; 49 $state.go('standard.dashboard'); 50 }); 51 }; 52 53 if ($location.$$path.indexOf('/verify/') === 0 && $scope.signupVerify.token) { 54 $scope.submitSignupVerify($scope.signupVerify); 55 } 56 57 var inputChangedPromise; 58 $scope.$watch('user.username', function () { 59 $scope.registrationForm.$invalid = true; 60 if (inputChangedPromise) { 61 $timeout.cancel(inputChangedPromise); 62 } 63 inputChangedPromise = $timeout(function () { 64 var email = $scope.user.username; 65 if (email !== undefined && email !== "") { 66 registrationService.checkEmail(email, function (data) { 67 $scope.foundUsers = data; 68 69 if (data !== "" && $location.$$path == "/registration") { 70 $scope.registrationForm.username.$setValidity("foundUser", false); 71 $scope.registrationForm.$invalid = true; 72 } 73 else if (data !== "" && $location.$$path == "/accessrequest") { 74 $scope.foundUser = true; 75 } 76 else { 77 $scope.registrationForm.username.$setValidity("foundUser", true); 78 $scope.registrationForm.$invalid = false; 79 $scope.foundUser = false; 80 } 81 82 }); 83 } 84 }, 500); 85 }); 86}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.