Aditya - Job Application Listing Page: allow public read access to the FAQ list - #2324
Open
AdiDubbs wants to merge 1 commit into
Open
Aditya - Job Application Listing Page: allow public read access to the FAQ list#2324AdiDubbs wants to merge 1 commit into
AdiDubbs wants to merge 1 commit into
Conversation
The job listing page at /collaboration is reachable without signing in, and its FAQ section reads from GET /faqs. Opens that one route in the global auth allowlist and drops its verifyToken guard. Matched on the exact path so the search, history, unanswered and write routes stay authenticated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
AdiDubbs
marked this pull request as ready for review
August 30, 2026 03:12
DeMoliT1on
approved these changes
Sep 1, 2026
DeMoliT1on
left a comment
There was a problem hiding this comment.
Tested locally for backend PR changes branch Aditya_fix_public_faq_endpoint and observed the following things.
Overall Assessment
Verified Working
- Public FAQ Endpoint:
GET /api/faqssuccessfully returns a200 OKstatus without an Authorization header. - Protected FAQ Sub-routes: Routes requiring authentication (e.g.,
GET /api/faqs/search) correctly return401 Unauthorizedwhen requested without a valid token. - Authenticated Access Preserved: Requests to protected endpoints with a valid JWT token continue to return
200 OKas expected.
Screenshots
The implementation accurately opens public access strictly for GET /api/faqs while keeping administrative and sub-routes securely protected.
Approved!
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.



Description
The job listing page at
/collaborationis public - it does not require signing in. Its FAQ section reads fromGET /faqs, which required a token, so a signed-out visitor received a 401 and got an error where the FAQs should be. This PR makes the changes to allow public read access to the FAQ listThis issue concerns Item 33.
Related PRS (if any):
Frontend: OneCommunityGlobal/HighestGoodNetworkApp#5473
Main changes explained:
GET /api/faqsto the global auth allowlist instartup/middleware.js. Thatapp.all('*')gate runs before every route, so removing the router's own guard alone had no effect. It is matched onreq.pathexactly rather than as a prefix, so the search, history, unanswered and write routes are untouched.verifyTokenfrom the/faqsroute infaqRouter.js.getAllFAQsdoes not readreq.user, so nothing in the handler depended on it.GET /api/jobsis already public in the same allowlist — that is how the job listing itself loads for visitors — so this follows the existing pattern for this page.How to test:
npm installredis-server --daemonize yesnpm run dev/api/faqs,/api/faqs/searchand/api/faqs/unansweredall return 200 as before — authenticated access is unchanged.npm run lintNote:
Not addressed here, found while testing:
GET /faqs/unansweredandDELETE /faqs/unanswered/:idcheck only for a token, not formanageFAQs, unlike the other management endpoints. The UI hides that page behind the permission, but any signed-in user can call those endpoints directly. Raised separately rather than mixed into this change.