Patch adonis5-jwt to fix jwt errors spamming - #163
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR patches the adonis5-jwt dependency to prevent repeated JWT persistence failures (e.g., SQLITE_CONSTRAINT: UNIQUE constraint failed: jwt_tokens.token) and adds coverage to ensure concurrent token issuance yields unique tokens.
Changes:
- Add a pnpm patch for
adonis5-jwtto add uniqueness to generated JWTs (JTI) and retry on duplicate-persistence errors. - Add a per-token nonce to JWT payloads in the UserController’s signup/login/new-token flows.
- Add functional tests validating concurrent login and new-token requests return distinct tokens.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/functional/api/register.spec.ts | Adds functional tests asserting concurrent requests produce unique JWTs. |
| app/Controllers/Http/UserController.ts | Adds a random nonce to JWT payloads to ensure token uniqueness across rapid requests. |
| patches/adonis5-jwt@1.1.7.patch | Patches the JWT guard to add JTI and retry persistence on unique-constraint collisions. |
| package.json | Registers the pnpm patched dependency. |
| pnpm-lock.yaml | Records the patch metadata and patched resolution for adonis5-jwt. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Errors keeps spamming on the server that have to do with an issue with adonis5-jwt dependency.
This PR fixes it.