Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not-using-dummy-secret error returned for valid token when custom environment variable configured #3

Open
WolfyUK opened this issue Feb 8, 2023 · 0 comments · May be fixed by #4
Open

Comments

@WolfyUK
Copy link

WolfyUK commented Feb 8, 2023

When using a custom next-hcaptcha.config.js and an environment variable containing the secret key that is not named HCAPTCHA_SECRET, all responses from https://hcaptcha.com/siteverify return the error code not-using-dummy-secret.

e.g.

/** @type import("next-hcaptcha").NextHCaptchaOptions */
const config = {
    envVarNames: { secret: "HCAPTCHA_SECRET_KEY" },
    errorDisplayMode: "code"
};

export default config;

With the response payload from the withHCaptcha HOC when using the 'success' test key and secret:

{ "success": false, "error-codes": ["not-using-dummy-secret"] }

The cause of this seems to be because the environment variable is not correctly set in the POST payload. A PR will be issued for this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant