mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-27 02:56:45 -05:00
fix: toast when no captcha
This commit is contained in:
@@ -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