Skip to content

soft_id get overwritten by value in defaultPayload #19

Open
@gohoski

Description

@gohoski

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions