diff --git a/README.md b/README.md index aec108f..b8e8c8f 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ idk jvs, seems to work on my machine... and yours too now??? - [X] add dev server env button - [X] discord link success/fail toast -- [ ] forgot password shows success toast even w no captcha (doesn't actually submit) +- [X] forgot password shows success toast even w no captcha (doesn't actually submit) - [ ] signup birthdate editor - [X] need error page diff --git a/src/assets/css/auth.css b/src/assets/css/auth.css index 97cd61d..bc58a47 100644 --- a/src/assets/css/auth.css +++ b/src/assets/css/auth.css @@ -134,7 +134,6 @@ form.account.register .h-captcha { } form.account.register p, -form.account.register div.email, form.account.register div.buttons { grid-column: 1 / span 2; } diff --git a/src/pages/account/forgot-password.vue b/src/pages/account/forgot-password.vue index d75473c..8524ab6 100644 --- a/src/pages/account/forgot-password.vue +++ b/src/pages/account/forgot-password.vue @@ -13,7 +13,7 @@ const { execute, isLoading } = useAsync({ if (captchaRef.value) { captchaResponse = await captchaRef.value.getToken(); if (!captchaResponse) { - return; + return false; } } @@ -24,12 +24,21 @@ const { execute, isLoading } = useAsync({ captchaResponse: captchaResponse ?? undefined } satisfies ApiAuthForgotPasswordRequest }); + + return true; }, - onSuccess() { - toasts.publish({ - type: 'success', - text: 'An email has been sent.' - }); + onSuccess(data) { + if (data) { + toasts.publish({ + type: 'success', + text: 'An email has been sent.' + }); + } else { + toasts.publish({ + type: 'error', + text: 'Please complete captcha.' + }); + } }, onError(error) { const err = getApiError(error);