Skip to content

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

@WolfyUK

Description

@WolfyUK

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions