Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Property 'nonce_supported' does not exist on type 'string | JwtPayload'

Open
#827 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, typescript

Research direction

Start with the jwt.decode call in the reproduction and inspect how @types/jsonwebtoken 8.5.8 types its payload; compare that with the library's 8.5.1 usage. Done means the sample's nonce_supported, iss, aud, and exp accesses type-check without errors.

Written by the indexing model from the issue text.

Description

Description

@types/jsonwebtoken 8.5.8 break the nestjs application,

sample code


import * as jwt from 'jsonwebtoken';

//  identityToken, nonce are props from apple signin

const decoded = jwt.decode(identityToken, { complete: true });

// ...

if (decoded.payload.nonce_supported && nonce !== NONCE) {
  // ...
}

if (!decoded.payload.iss || decoded.payload.iss !== APPLE_BASE_URL) {
  // ...
}

if (decoded.payload.aud !== 'my.aud.string') {
  // ...
}

if (Number(decoded.payload.exp) * 1000 < my_expr_limit) {
  // ...
}

error message:

Property 'nonce_supported' does not exist on type 'string | JwtPayload'.
  Property 'nonce_supported' does not exist on type 'string'.

Property 'iss' does not exist on type 'string | JwtPayload'.
  Property 'iss' does not exist on type 'string'.

Property 'aud' does not exist on type 'string | JwtPayload'.
  Property 'aud' does not exist on type 'string'.

Property 'exp' does not exist on type 'string | JwtPayload'.
  Property 'exp' does not exist on type 'string'.
Reproduction
  1. create a nestjs app
  2. add "jsonwebtoken": "^8.5.1", to your package.json
  3. implement apple sign in as the sample above
  4. npm install
  5. npm run start then you can see the errors
Environment

Please provide the following:

  • Version of this library used: 8.5.1
  • Version of the platform or framework used, if applicable: node 16.13.1, npm 8.1.2
  • Other relevant versions (language, server software, OS, browser): OS Mac M1
  • Other modules/plugins/libraries that might be involved: "@types/jsonwebtoken": "8.5.8",
Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.