Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#827 6 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
node.js, typescript

Direzione di ricerca

Inizia con la chiamata a jwt.decode nella riproduzione e verifica come @types/jsonwebtoken 8.5.8 tipizza il suo payload; confrontalo con l'utilizzo della libreria in 8.5.1. È completato quando gli accessi dell'esempio a nonce_supported, iss, aud ed exp superano il controllo dei tipi senza errori.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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",
Lingua principale
JavaScript
Stelle
18.2k
Fork
1.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di auth0/node-jsonwebtoken

Tutte le issue di auth0/node-jsonwebtoken

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.