Closed shelou closed 2 years ago
Mmm, afraid you'll need at least TypeScript 4 :|
Work around is to run in JS (not in TS) or change the import
to a require
but you'll loose type checking then:
// NOT: import { CognitoJwtVerifier } from "aws-jwt-verify";
const { CognitoJwtVerifier } = require("aws-jwt-verify"); // Works, but you loose type checking
Or upgrade to TypeScript 4 of course for a proper solution
For consideration, it might be possible to support TypeScript 3 also, using this: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions
We'll have to decide if the effort is worth the value.
@ottokruse thank you so much! Upgrading typescript did the job
hello, I am using the CognitoJwtVerifier.create but got an error CognitoJwtVerifier.create is not a function. kindly guide me. code: const verifier = CognitoJwtVerifier.create({ userPoolId: process.env.AWS_COGNITO_USERPOOL, tokenUse: "access", clientId: process.env.AWS_COGNITO_CLIENT_ID, });
Please create a separate issue and provide us a complete example with which to reproduce (i.e. one that at least also shows how you import the library)
What are the steps to reproduce this issue?
What happens? verify function gives an error: TS2554: Expected 4 arguments, but got 1
What versions of software are you using? "typescript": "^3.9.10", "ts-node": "^8.10.2", "aws-jwt-verify": "1.0.3", and also tried version 1.0.2