diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index be3e8adab8a1a56c66f3f81960920b119910dab0..00aa714a6f23e14e2bcafe407d3e23520b7ec469 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -152,6 +152,15 @@ class AccountController extends Controller { $this->userService->sendWelcomeEmail($displayname, $username, $userEmail, $language); + $this->session->remove(self::SESSION_USERNAME_CHECK); + $this->session->remove(self::CAPTCHA_VERIFIED_CHECK); + + try { + $this->userService->addUsernameToCommonDataStore($username); + } catch (Exception $e) { + $this->logger->logException($e, ['app' => Application::APP_ID]); + } + $response->setStatus(200); $response->setData(['success' => true]); @@ -160,14 +169,6 @@ class AccountController extends Controller { $response->setStatus(500); } - $this->session->remove(self::SESSION_USERNAME_CHECK); - $this->session->remove(self::CAPTCHA_VERIFIED_CHECK); - - try { - $this->userService->addUsernameToCommonDataStore($username); - } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); - } return $response; } /** diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index d8995194dd49a64bcd857b47f827cf9accfb8216..c4c187ac9e41ae36917102b0dff7028152537027 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -306,6 +306,10 @@ class UserService { if(count($users)) { return true; } + $users = $this->config->getUsersForUserValue('email-recovery', 'unverified-recovery-email', $recoveryEmail); + if(count($users)) { + return true; + } return false; } diff --git a/src/Signup.vue b/src/Signup.vue index 8be5e5cf6e0e991ef80fd126b45f66e8c437062f..4fa39636d72f85db7a33ea3bc6cf93278ba57b48 100644 --- a/src/Signup.vue +++ b/src/Signup.vue @@ -51,6 +51,14 @@ export default { showSuccessSection: false, } }, + mounted() { + // Extracting the recovery email from the URL when the component is mounted + const urlParams = new URLSearchParams(window.location.search) + const recoveryEmail = urlParams.get('recoveryEmail') + + // Set formData.email directly to recoveryEmail + this.formData.email = recoveryEmail || '' + }, methods: { submitRegistrationForm(data) { if (data.isFormValid) {