Fix: require token authentication, limit payload fields, and rate lim… - #232
Merged
Premshaw23 merged 1 commit intoMay 21, 2026
Merged
Conversation
Contributor
|
@omnipotentchaos is attempting to deploy a commit to the Prem Shaw's projects Team on Vercel. A member of the Team first needs to authorize it. |
Premshaw23
approved these changes
May 21, 2026
Owner
|
done👍 |
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.
What type of PR is this?
Description
Secures the
/api/labelsendpoint by requiring Firebase ID token authentication, enforcing data projections to prevent PII exposure, and adding rate limiting to block user enumeration attacks.Related Issues
Closes #171
Changes Made
/api/labelsGET route to verify authenticated users. Returns401 Unauthorizedon failure.{ _id: 0, name: 1, email: 1, image: 1 }, ensuring internal database IDs or metadata are never returned.429 Too Many Requestswhen exceeded.useLabelshook to expect the logged-in user and include the Bearer token header in request fetching.components/_tests_/labelsRoute.test.jschecking missing headers, token errors, projection correctness, and rate limit triggers.Testing
How did you test these changes?
npm test- all 48 unit tests passed successfully)npm run buildTest Suite Output