fix: captcha preview panic when clientId or clientSecret is empty (#824)

* fix: captcha preview panic when clientId or clientSecret is empty

* return original errors from captcha
This commit is contained in:
Resulte Lee
2022-06-26 22:09:57 +08:00
committed by GitHub
parent 339c6c2dd0
commit 477d386f3c
4 changed files with 20 additions and 6 deletions

View File

@ -117,7 +117,7 @@ export const CaptchaPreview = ({ provider, providerName, clientSecret, captchaTy
return (
<React.Fragment>
<Button style={{ fontSize: 14 }} type={"primary"} onClick={clickPreview}>
<Button style={{ fontSize: 14 }} type={"primary"} onClick={clickPreview} disabled={captchaType !== "Default" && (!clientId || !clientSecret)}>
{i18next.t("general:Preview")}
</Button>
<Modal