public cacheJwks()

in src/cognito-verifier.ts [381:394]


  public cacheJwks(
    ...[jwks, userPoolId]: MultiIssuer extends false
      ? [jwks: Jwks, userPoolId?: string]
      : [jwks: Jwks, userPoolId: string]
  ): void {
    let issuer: string | undefined;
    if (userPoolId !== undefined) {
      issuer = CognitoJwtVerifier.parseUserPoolId(userPoolId).issuer;
    } else if (this.expectedIssuers.length > 1) {
      throw new ParameterValidationError("userPoolId must be provided");
    }
    const issuerConfig = this.getIssuerConfig(issuer);
    super.cacheJwks(jwks, issuerConfig.issuer);
  }