Skip to content

Commit

Permalink
Merge pull request #27 from vastus/vastus/update-verify-response-type
Browse files Browse the repository at this point in the history
Update VerifyResponse type
  • Loading branch information
vastus authored Jun 26, 2024
2 parents 5e8feb6 + 68640b4 commit 2edfcad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ type VerifyResponse = {

/** List of error codes. Present if success is false */
"error-codes"?: string[],

/** A score denoting malicious activity. (Optional b/c of ENTERPRISE feature) */
score?: number,

/** Reason(s) for score. (Optional b/c of ENTERPRISE feature) */
score_reason?: string[],
};

declare module "hcaptcha" {
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('hCaptcha', function () {
verify(secret, token)
.then(done.fail)
.catch(error => {
assert.strictEqual(error.message, 'Unexpected token < in JSON at position 0')
assert.match(error.message, /unexpected token/i);
done()
});
});
Expand Down

5 comments on commit 2edfcad

@Kanhu84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@Kanhu84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@Kanhu84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@Kanhu84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intrest

@Kanhu84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uploading IMG-20240828-WA0008.jpg…

Please sign in to comment.