Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 906cf933 authored by Ronak Patel's avatar Ronak Patel
Browse files

Merge branch 'dev/backward-compatible' into 'main'

added recovery email as param

See merge request !95
parents 60505e17 4c77f797
Loading
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -152,14 +152,6 @@ class AccountController extends Controller {
		
			$this->userService->sendWelcomeEmail($displayname, $username, $userEmail, $language);
			
			$response->setStatus(200);
			$response->setData(['success' => true]);

		} catch (Exception $e) {
			$response->setData(['message' => $e->getMessage(), 'success' => false]);
			$response->setStatus(500);
		}

			$this->session->remove(self::SESSION_USERNAME_CHECK);
			$this->session->remove(self::CAPTCHA_VERIFIED_CHECK);

@@ -168,6 +160,15 @@ class AccountController extends Controller {
			} catch (Exception $e) {
				$this->logger->logException($e, ['app' => Application::APP_ID]);
			}
			
			$response->setStatus(200);
			$response->setData(['success' => true]);

		} catch (Exception $e) {
			$response->setData(['message' => $e->getMessage(), 'success' => false]);
			$response->setStatus(500);
		}

		return $response;
	}
	/**
+4 −0
Original line number Diff line number Diff line
@@ -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;
	}

+8 −0
Original line number Diff line number Diff line
@@ -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) {