diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index e33cd9818d3cb9bb4154331b7cb2734b571ef6d4..059dcc4c04b66ba2d9e8d6f30ebcd0201a51cd78 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -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; } diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 342aeeaac66b6d1259c7a34bab26ea8b61ff997d..b0720bd552dc03d8184c9c0544f279b9684c57cf 100644 --- a/src/signup/CaptchaForm.vue +++ b/src/signup/CaptchaForm.vue @@ -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()}`) + }, }, }