Skip to content

feat: Implement JWT authentication module with token generation and v…#663

Merged
nafiuishaaq merged 2 commits into
MentoNest:mainfrom
Songu3020:SkillSync_Server
Jun 1, 2026
Merged

feat: Implement JWT authentication module with token generation and v…#663
nafiuishaaq merged 2 commits into
MentoNest:mainfrom
Songu3020:SkillSync_Server

Conversation

@Songu3020
Copy link
Copy Markdown
Contributor

closes #461

PR Title
Implement secure JWT access token issuance with versioned invalidation

PR Description
Added secure JWT generation using @nestjs/jwt in auth.module.ts
Supports signing with HS256 or RS256 based on JWT_SIGNING_ALG
Added standard JWT claims: iss, aud, iat, exp, jti
Configured token expiration from env JWT_ACCESS_EXPIRATION with default 15m
Extended payload to include:
sub (user id)
wallet
roles
permissions
jti
ver
Implemented token versioning and invalidation in jwt.service.ts
Updated validation in jwt.strategy.ts to verify signature, claims, and token version/invalidation timestamp
Ensures forced logout on version changes (e.g. role updates or password-equivalent changes)
Files changed
auth.module.ts
jwt.service.ts
jwt.strategy.ts
Notes
Uses environment config for secrets and issuer/audience values
No TypeScript diagnostics reported on updated files

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Songu3020 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! 🚀

Learn more about application limits

@nafiuishaaq nafiuishaaq merged commit dcad1d9 into MentoNest:main Jun 1, 2026
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.

JWT access token issuance

2 participants