Changes
Build and Push Docker Images / build (push) Successful in 28s

This commit is contained in:
2026-05-06 15:26:25 +03:00
parent a10908364b
commit a926c214e1
10 changed files with 40 additions and 66 deletions
+28 -14
View File
@@ -461,7 +461,7 @@
if (window.grecaptcha && reCaptchaSiteKey) {
grecaptcha.ready(function () {
grecaptcha.execute(reCaptchaSiteKey, {
action: 'contact'
action: 'cv_upload'
}).then(postCv);
});
} else {
@@ -470,7 +470,7 @@
$button.prop('disabled', false).text(t('cv.submit'));
return;
}
function postCv(token) {
async function postCv(token) {
try {
var formData = new FormData();
formData.append('cv', file);
@@ -482,19 +482,33 @@
});
if (!cvResponse.ok) throw new Error(t('cv.cvFailed'));
var cvData = await cvResponse.json();
// Before calling match, obtain a fresh captcha token for the match action
if (!(window.grecaptcha && reCaptchaSiteKey)) {
throw new Error(t('form.captchaFailed'));
}
// get match token
var matchToken = await new Promise(function (resolve, reject) {
try {
grecaptcha.ready(function () {
grecaptcha.execute(reCaptchaSiteKey, { action: 'match_job' }).then(resolve).catch(reject);
});
} catch (e) { reject(e); }
});
var matchResponse = await fetch('/api/cv-matcher/match-job', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
cvDocumentId: cvData.documentId || cvData.cvDocumentId,
jobUrl: jobUrl,
jobDescription: jobDescription,
gdprConsent: consent,
captchaToken: token
})
});
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
cvDocumentId: cvData.documentId || cvData.cvDocumentId,
jobUrl: jobUrl,
jobDescription: jobDescription,
gdprConsent: consent,
captchaToken: matchToken
})
});
if (!matchResponse.ok) throw new Error(t('cv.matchFailed'));
var match = await matchResponse.json();
renderMatchResult(match);