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

Commit 3c711bc2 authored by Ronak Patel's avatar Ronak Patel
Browse files

Merge branch 'dev/refresh-captcha' into 'main'

Refresh captcha url on fail

See merge request !91
parents 6616dfe2 a6ac8ae8
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -248,10 +248,10 @@ class AccountController extends Controller {
		$captchaResult = (string) $this->session->get(CaptchaService::CAPTCHA_RESULT_KEY, '');
		$response->setStatus(400);
		if ($captchaResult === $captchaInput) {
			$this->session->remove(CaptchaService::CAPTCHA_RESULT_KEY);
			$this->session->set(self::CAPTCHA_VERIFIED_CHECK, true);
			$response->setStatus(200);
		}
		$this->session->remove(CaptchaService::CAPTCHA_RESULT_KEY);
		return $response;
	}

+4 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ export default {
				this.$emit('form-submitted', { isFormValid })
			} catch (error) {
				this.validation.isCaptchaInputNotMatched = true
				this.refreshCaptchaImage()
			}
		},
		submitCaptchaForm() {
@@ -105,6 +106,9 @@ export default {
		showMessage(message, type) {
			type === 'success' ? showSuccess(message) : showError(message)
		},
		refreshCaptchaImage() {
			this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?v=${Date.now()}`)
		},
	},
}
</script>