You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
Does the ts code actually work? I tired to fix it but no luck.
$ ts-node decode-verify-jwt.ts
/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:692
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
aws.ts:93:19 - error TS2352: Conversion of type'SigningKeyCallback' to type'Claim' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'SigningKeyCallback' is missing the following properties from type'Claim': token_use, auth_time, iss, exp, and 2 more.
93 const claim = await verifyPromised(token, key.pem) as Claim;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aws.ts:93:47 - error TS2554: Expected 1 arguments, but got 2.
93 const claim = await verifyPromised(token, key.pem) as Claim;~~~~~~~
at createTSError (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:692:12)
at reportTSError (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:696:19)
at getOutput (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:883:36)
at Object.compile (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1185:30)
at Module.m._compile (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1309:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.require.extensions.<computed> [as .ts] (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1313:12)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
diagnosticText: "\x1B[96maws.ts\x1B[0m:\x1B[93m93\x1B[0m:\x1B[93m19\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2352: \x1B[0mConversion of type 'SigningKeyCallback' to type 'Claim' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.\n" +
" Type 'SigningKeyCallback' is missing the following properties from type 'Claim': token_use, auth_time, iss, exp, and 2 more.\n" +
'\n' +
'\x1B[7m93\x1B[0m const claim = await verifyPromised(token, key.pem) as Claim;\n' +
'\x1B[7m \x1B[0m \x1B[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\x1B[0m\n' +
'\x1B[96maws.ts\x1B[0m:\x1B[93m93\x1B[0m:\x1B[93m47\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2554: \x1B[0mExpected 1 arguments, but got 2.\n' +
'\n' +
'\x1B[7m93\x1B[0m const claim = await verifyPromised(token, key.pem) as Claim;\n' +
'\x1B[7m \x1B[0m \x1B[91m ~~~~~~~\x1B[0m\n',
diagnosticCodes: [ 2352, 2554 ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:692
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
aws.ts:93:19 - error TS2352: Conversion of type'SigningKeyCallback' to type'Claim' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'SigningKeyCallback' is missing the following properties from type'Claim': token_use, auth_time, iss, exp, and 2 more.
93 const claim = await verifyPromised(token, key.pem) as Claim;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aws.ts:93:47 - error TS2554: Expected 1 arguments, but got 2.
93 const claim = await verifyPromised(token, key.pem) as Claim;~~~~~~~
at createTSError (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:692:12)
at reportTSError (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:696:19)
at getOutput (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:883:36)
at Object.compile (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1185:30)
at Module.m._compile (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1309:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.require.extensions.<computed> [as .ts] (/home/WD4TB/websites/hdt/research/aws-cognito-validate-jwt/node_modules/ts-node/src/index.ts:1313:12)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
diagnosticText: "\x1B[96maws.ts\x1B[0m:\x1B[93m93\x1B[0m:\x1B[93m19\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2352: \x1B[0mConversion of type 'SigningKeyCallback' to type 'Claim' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.\n" +
" Type 'SigningKeyCallback' is missing the following properties from type 'Claim': token_use, auth_time, iss, exp, and 2 more.\n" +
'\n' +
'\x1B[7m93\x1B[0m const claim = await verifyPromised(token, key.pem) as Claim;\n' +
'\x1B[7m \x1B[0m \x1B[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\x1B[0m\n' +
'\x1B[96maws.ts\x1B[0m:\x1B[93m93\x1B[0m:\x1B[93m47\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2554: \x1B[0mExpected 1 arguments, but got 2.\n' +
'\n' +
'\x1B[7m93\x1B[0m const claim = await verifyPromised(token, key.pem) as Claim;\n' +
'\x1B[7m \x1B[0m \x1B[91m ~~~~~~~\x1B[0m\n',
diagnosticCodes: [ 2352, 2554 ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
rajinder-yadav
changed the title
decode-verify-jwt.ts don't compile
decode-verify-jwt.ts does not compile
Sep 24, 2021
Does the ts code actually work? I tired to fix it but no luck.
The text was updated successfully, but these errors were encountered: