Skip to content

105 Add Authentication Check to Projects Routes#140

Open
bhuvanh66 wants to merge 2 commits intomainfrom
105-auth-projects
Open

105 Add Authentication Check to Projects Routes#140
bhuvanh66 wants to merge 2 commits intomainfrom
105-auth-projects

Conversation

@bhuvanh66
Copy link
Contributor

ℹ️ Issue

Closes #105

📝 Description

Added authentication to the projects lambda to protect its endpoints from unauthorized access. Without this, anyone with the URL could read or create projects once the lambda is made public.

Briefly list the changes made to the code:

  1. Created auth.ts to verify Cognito JWTs and load the matching user from the database
  2. Updated handler.ts to authenticate every request before running any route logic
  3. Updated both test files to mock authentication so tests call handler directly instead of the live endpoint

✔️ Verification

Clone the branch and run npx jest from apps/backend/lambdas/projects
All tests should pass without a running Cognito instance since auth is mocked

Screenshot 2026-02-19 at 6 08 48 PM Screenshot 2026-02-19 at 6 09 10 PM

@github-actions github-actions bot requested a review from Rayna-Yu February 19, 2026 23:10
github-actions bot added a commit that referenced this pull request Feb 19, 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.

Add Authentication Check to Projects Routes

2 participants

Comments