Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#827 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
node.js, typescript

調査の方向性

再現コードの jwt.decode 呼び出しから始め、@types/jsonwebtoken 8.5.8 が payload をどのように型付けしているかを確認します。それをライブラリの 8.5.1 での使用方法と比較します。サンプルの nonce_supported、iss、aud、exp へのアクセスがエラーなしで型チェックを通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

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",
主要言語
JavaScript
スター
18.2k
フォーク
1.3k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

auth0/node-jsonwebtoken のほかの issue

auth0/node-jsonwebtoken の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。