-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/permissions too large in jwt #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses JWT token size issues by implementing compression for JWT payload fields, reducing token size by approximately 75%. It also updates the page title to 'Sanctus Omega Broderskab' and improves development experience by reducing JWT error spam during development.
Changes:
- Added JWT compression/decompression using zlib to reduce token size for permissions, memberships, and user fields
- Updated authentication logger to treat JWT session errors as warnings instead of errors during development
- Changed application metadata with proper title, description, and keywords
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/auth/nextAuth/jwtCompression.ts | New utility module implementing compression and decompression of JWT fields using zlib |
| src/auth/nextAuth/authOptions.ts | Integrated JWT compression into encode/decode flow and added custom logger to reduce development noise |
| src/app/layout.tsx | Updated page metadata with proper title, description, and keywords for the organization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is not very elegant nor type safe. However, it resolves the JWT error spamming in the console. JWT size has been reduced by around 75%.
I also changed the page title to 'Sanctus Omega Brodserskab' finally and removed errors on invalid JWT token (no more spam about that during dev).