Add configurable JWT access token issuance - #1045
Merged
nafiuishaaq merged 5 commits intoAug 2, 2026
Merged
Conversation
|
@Vox-d-glitch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Rebuilds MentoNest#974 on top of the current wallet-auth/RBAC architecture: centralizes JWT signing config (HS256/RS256 via JWT_ALGORITHM) into a shared factory used by both AuthModule and UsersModule, and adds a permissions claim derived from roles to the access token payload.
Vox-d-glitch
force-pushed
the
issue-974-jwt-token-issuance
branch
from
July 26, 2026 20:38
153e9c8 to
5094cc4
Compare
- auth.controller.ts had two full AuthController class bodies concatenated (a botched prior merge), which broke parsing for the whole file and cascaded into unrelated eslint type-resolution errors repo-wide - add missing @nestjs/swagger dependency (used throughout but never added to package.json) - fix relative import paths in auth.service.ts (an extra '../' pointed outside src/auth, breaking NodeNext module resolution) - add .js extensions to relative imports per the project's nodenext moduleResolution, removing further unresolved-type cascades - remove JwtAuthGuard's unresolvable third constructor parameter (a bare function type Nest can never inject), small unused-import/no-await cleanups, and a wrong TypeORM option name (connectTimeout -> connectTimeoutMS) - apply repo-wide prettier formatting (was never run on ~50 files) Lint: 95 errors -> 0. Build: failing -> passing. Prettier: 51 files -> 0.
…ation These specs were written against a device-aware, RefreshTokenService + UsersService backed refresh-token design that was never wired into AuthService/AuthController — the real implementation still uses the simpler in-memory nonce/token-map flow. Rewrite both specs to exercise what's actually there instead of leaving them permanently red.
Contributor
|
Please reslove conflict |
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.
Adds a
TokenServicethat issues access tokens carryingsub,wallet,roles,permissionsand ajticlaim, replacing the previous hardcoded 1h HS256-only signing setup.JWT_ALGORITHM,JWT_SECRETorJWT_PRIVATE_KEY/JWT_PUBLIC_KEY,JWT_ACCESS_EXPIRATION, default15m) via a sharedJwtModulefactoryROLE_PERMISSIONSmapJwtAuthGuardnow verifies using the same module configuration instead of a hardcoded secret lookup, so it works transparently with either algorithmCloses #974