Skip to content

docs: replace deprecated ExpressJwtRequest in usage example - #358

Open
cpruijsen wants to merge 1 commit into
auth0:masterfrom
cpruijsen:fix/issue-341
Open

cpruijsen wants to merge 1 commit into
auth0:masterfrom
cpruijsen:fix/issue-341

Conversation

@cpruijsen

Copy link
Copy Markdown

Replace the Usage ES6 import of ExpressJwtRequest with Request as JWTRequest, matching the TypeScript section of the same README. Add a README assertion so a deprecated express-jwt import of ExpressJwtRequest fails the test suite.

Closes #341

Provenance

ExpressJwtRequest was deprecated for breaking tsc with strict: true, in favor of Request with optional auth (#284). José F. Romaniello: use that type always. The TypeScript section was updated in that work and later clarified in 8.3.0 (3c1d5cf); the Usage ES6 line was missed.

Decision

The Usage ES6 line imports Request as JWTRequest, the smallest change that matches the TypeScript section already in this README. Alternative: drop the type from the JavaScript Usage import (import { expressjwt } from "express-jwt"). Can drop the type from Usage instead if that sample should stay untyped.

test/readme.test.ts is a mocha assertion over the README import. Alternative: README-only, as in 3c1d5cf. The regression is a one-line docs drift that already survived one deprecation pass. Can drop test/readme.test.ts if you would rather not snapshot the README.

Internal tests still import the deprecated alias; they were left alone because the type remains exported.

Test plan

  • README Usage ES6 import no longer names ExpressJwtRequest
  • README TypeScript section still uses Request as JWTRequest
  • npx mocha --reporter spec --require ts-node/register test/readme.test.ts fails with the old Usage line and passes with the new one
  • npm test: 42 passing

The Usage ES6 import still showed ExpressJwtRequest after it was
deprecated in favor of Request. Match the TypeScript section.

Closes auth0#341
@cpruijsen
cpruijsen requested a review from a team as a code owner September 12, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deprecated ExpressJWTRequest is still in docs

1 participant