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

soft_id get overwritten by value in defaultPayload #19

Open
gohoski opened this issue Jan 4, 2025 · 0 comments
Open

soft_id get overwritten by value in defaultPayload #19

gohoski opened this issue Jan 4, 2025 · 0 comments

Comments

@gohoski
Copy link

gohoski commented Jan 4, 2025

When entering a soft_id in any of the functions, the soft_id gets overwritten by the value in the defaultPayload. This happens because the params object is being entered first, then the defaultPayload, which will overwrite the parameters from the params object:

    public async recaptcha(params: paramsRecaptcha): Promise<CaptchaAnswer> {
        checkCaptchaParams(params, "userrecaptcha")
        const payload = {
            ...params,
            method: "userrecaptcha",
            ...this.defaultPayload
        }

...this.defaultPayload and ...params need to be swapped in all functions to fix this.

Also, for some reason, not all functions even support the soft_id parameter, e.g. the coordinates function doesn't because it isn't specified in the paramsCoordinates interface. Hope that you fix both of these issues

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

No branches or pull requests

1 participant