Skip to content

Auth middlware#511

Merged
RJ-Tabelon merged 4 commits intomainfrom
auth-middlware
Apr 1, 2026
Merged

Auth middlware#511
RJ-Tabelon merged 4 commits intomainfrom
auth-middlware

Conversation

@nocturne918
Copy link
Copy Markdown
Collaborator

📝 Description

Resolves #461. Added two middleware functions pertaining to route protection that standardize API endpoint access. Then refactored 6 endpoints to use this middleware and removed redundant logic.

requireSession parses the sessionId cookie, validates the session against the database, and injects the session object into Hono context

requireRoles chains after requireSession and protects routes to be accessed only by users with specific roles

🧪 How to

  1. Pull this branch
  2. Run bun install
  3. Run bun test

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
uf-sase-website Ready Ready Preview, Comment Apr 1, 2026 0:02am

@RJ-Tabelon RJ-Tabelon merged commit 41c9606 into main Apr 1, 2026
5 checks passed
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.

Create reusable verifyAuth middleware

2 participants