Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"start": "gulp dev",
"prebuild": "rm -rf build",
"build": "microbundle --target web --external none",
"build": "microbundle --target web --external none --generateTypes false",
"postbuild": "node scripts/print-bundle-size",
"test": "cross-env NODE_ENV=test mocha --require @babel/register test/**/*.test.js --exit",
"test:watch": "cross-env NODE_ENV=test mocha --require @babel/register --watch --reporter min test/*.test.js",
Expand Down
21 changes: 19 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ declare class IdTokenVerifier {
jwksURI: any;
maxAge: any;
__clock: any;

/**
* @callback verifyCallback
* @param {?Error} err error returned if the verify cannot be performed
* @param {?object} payload payload returned if the token is valid
*/

/**
* Verifies an id_token
*
Expand All @@ -90,10 +92,25 @@ declare class IdTokenVerifier {
*
* @method verify
* @param {string} token id_token to verify
* @param {string} [requestedNonce] nonce value that should match the one in the id_token claims
* @param {string} requestedNonce nonce value that should match the one in the id_token claims
* @param {verifyCallback} cb callback used to notify the results of the validation
*/
verify(token: string, requestedNonce?: string, cb: verifyCallback): any;
verify(token: string, requestedNonce: string, cb: verifyCallback): any;
Copy link
Contributor

Choose a reason for hiding this comment

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

@stevehobbsdev if requestedNonce is no longer optional, shouldn't the param doc line above stop using the [ ... ] ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - good catch, I'll amend it. Thanks!


/**
* Verifies an id_token
*
* It will validate:
* - signature according to the algorithm configured in the verifier.
* - if `iss` and `aud` claims matches the configured issuer and audience
* - if token is not expired and valid (if the `nbf` claim is in the past)
*
* @method verify
* @param {string} token id_token to verify
* @param {verifyCallback} cb callback used to notify the results of the validation
*/
verify(token: string, cb: verifyCallback): any;

getRsaVerifier(iss: any, kid: any, cb: any): void;
/**
* @typedef DecodedToken
Expand Down