mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
feat: fix secret information issue in the CAPTCHA provider code (#2531)
This commit is contained in:
@ -153,11 +153,12 @@ export function sendCode(captchaType, captchaToken, clientSecret, method, countr
|
||||
});
|
||||
}
|
||||
|
||||
export function verifyCaptcha(captchaType, captchaToken, clientSecret) {
|
||||
export function verifyCaptcha(owner, name, captchaType, captchaToken, clientSecret) {
|
||||
const formData = new FormData();
|
||||
formData.append("captchaType", captchaType);
|
||||
formData.append("captchaToken", captchaToken);
|
||||
formData.append("clientSecret", clientSecret);
|
||||
formData.append("applicationId", `${owner}/${name}`);
|
||||
return fetch(`${Setting.ServerUrl}/api/verify-captcha`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
|
@ -50,7 +50,7 @@ export const CaptchaPreview = (props) => {
|
||||
};
|
||||
|
||||
const onOk = (captchaType, captchaToken, clientSecret) => {
|
||||
UserBackend.verifyCaptcha(captchaType, captchaToken, clientSecret).then(() => {
|
||||
UserBackend.verifyCaptcha(owner, name, captchaType, captchaToken, clientSecret).then(() => {
|
||||
setVisible(false);
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user