Skip to content

Commit

Permalink
fix: #74, recaptcha failing even if verified ok
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Jun 22, 2020
1 parent 262f23b commit 9c04b2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ Plugin._recaptchaCheck = function (req, res, userData, next) {
};

Plugin._hcaptchaCheck = async (userData) => {
if (pluginSettings.hCaptchaEnabled !== 'on') {
return;
}

const response = await hCaptcha.verify(pluginSettings.hCaptchaSecretKey, userData['h-captcha-response']);
if (!response.success) {
throw new Error('Captcha not verified, are you a robot?');
Expand Down

0 comments on commit 9c04b2e

Please sign in to comment.