mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-23 09:07:40 -05:00
fix: toast when no captcha
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user