fix: toast when no captcha

This commit is contained in:
limes
2026-08-17 23:24:56 +02:00
parent a9e3ce1658
commit 1f5745d8a1
3 changed files with 16 additions and 8 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);