From 1c7e25e0444828858980353d10e7820a9019319c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 17:37:58 -0800 Subject: [PATCH 1/7] Refresh captcha url on fail --- src/signup/CaptchaForm.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 342aeeaa..65cf2c11 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,13 @@ export default { showMessage(message, type) { type === 'success' ? showSuccess(message) : showError(message) }, + async refreshCaptchaImage() { + try { + this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha`) + } catch (error) { + console.error('Error refreshing captcha image:', error) + } + }, }, } -- GitLab From cd6dc313c47f9defa63a99af1b5e25a0304dea38 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 17:42:49 -0800 Subject: [PATCH 2/7] added timestamp --- src/signup/CaptchaForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 65cf2c11..7999bd9e 100644 --- a/src/signup/CaptchaForm.vue +++ b/src/signup/CaptchaForm.vue @@ -108,7 +108,7 @@ export default { }, async refreshCaptchaImage() { try { - this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha`) + this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?timestamp=${Date.now()}`) } catch (error) { console.error('Error refreshing captcha image:', error) } -- GitLab From 9c18055133422117b98975b11e1fbbd301a02878 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 17:46:34 -0800 Subject: [PATCH 3/7] removed async --- src/signup/CaptchaForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 7999bd9e..7512c724 100644 --- a/src/signup/CaptchaForm.vue +++ b/src/signup/CaptchaForm.vue @@ -106,7 +106,7 @@ export default { showMessage(message, type) { type === 'success' ? showSuccess(message) : showError(message) }, - async refreshCaptchaImage() { + refreshCaptchaImage() { try { this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?timestamp=${Date.now()}`) } catch (error) { -- GitLab From 48439d9baf0d24f629ca8096c92e9a336e6472f3 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 17:49:11 -0800 Subject: [PATCH 4/7] remove try.catch --- src/signup/CaptchaForm.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 7512c724..24909c65 100644 --- a/src/signup/CaptchaForm.vue +++ b/src/signup/CaptchaForm.vue @@ -107,11 +107,7 @@ export default { type === 'success' ? showSuccess(message) : showError(message) }, refreshCaptchaImage() { - try { - this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?timestamp=${Date.now()}`) - } catch (error) { - console.error('Error refreshing captcha image:', error) - } + this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?timestamp=${Date.now()}`) }, }, } -- GitLab From a8d8b5b7d8989f968b859757b1673aba3ffe97f4 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 21:59:25 -0800 Subject: [PATCH 5/7] remove session at verification --- lib/Controller/AccountController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index e33cd981..1e95c5cf 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -252,6 +252,7 @@ class AccountController extends Controller { $this->session->set(self::CAPTCHA_VERIFIED_CHECK, true); $response->setStatus(200); } + $this->session->remove(CaptchaService::CAPTCHA_RESULT_KEY); return $response; } -- GitLab From 256cb3e22cf4b75497071c5576cabbda28e9ea16 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 27 Dec 2023 22:00:01 -0800 Subject: [PATCH 6/7] remove session at verification --- lib/Controller/AccountController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 1e95c5cf..059dcc4c 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -248,7 +248,6 @@ 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); } -- GitLab From 284d3c2499e3030d919d28b553f2c9d5402e2dd2 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 28 Dec 2023 12:24:34 -0800 Subject: [PATCH 7/7] v added --- src/signup/CaptchaForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/CaptchaForm.vue b/src/signup/CaptchaForm.vue index 24909c65..b0720bd5 100644 --- a/src/signup/CaptchaForm.vue +++ b/src/signup/CaptchaForm.vue @@ -107,7 +107,7 @@ export default { type === 'success' ? showSuccess(message) : showError(message) }, refreshCaptchaImage() { - this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?timestamp=${Date.now()}`) + this.captchaImageUrl = generateUrl(`/apps/${this.appName}/accounts/captcha?v=${Date.now()}`) }, }, } -- GitLab