Skip to content

Commit e496a8e

Browse files
committed
feat: ✨ added default value for key path
1 parent 3842688 commit e496a8e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/jwt.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ export class Verifier<T extends BaseClaims> {
3434
}
3535

3636
/**
37-
* Static method to instantiate a Verifier class
37+
* Static method to instantiate a Verifier class from an existing token
38+
* This is useful when you wanna use the instance caching so public keys are cached
39+
* and the issuer url can be taken from the token
3840
* @param inputToken The input token you get from the request
39-
* @param keysUrlPath The URL path to the public keys
41+
* @param keysUrlPath The path to the public keys json from the iss url
4042
* @param disableCaching Caches keys for 24 hours, defaults to false
4143
* @returns {Verifier} Returns an instance of Verifier class
4244
*/
4345
public static fromToken<T extends BaseClaims>(
4446
inputToken: string,
45-
keysUrlPath: string,
47+
keysUrlPath = ".well-known/jwks.json",
4648
disableCaching = false
4749
): Verifier<T> {
4850
const parsedToken = jwtDecode<T>(this.getCleanedJwt(inputToken));

0 commit comments

Comments
 (0)