security: JWT token extraction missing Bearer scheme handling #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The authentication middleware extracts tokens from the Authorization header but doesn't properly handle the standard "Bearer" scheme. It accepts any token in the header, and if a Bearer token is provided, it will pass the entire string "Bearer " to the JWT verification, causing verification to fail silently or with confusing errors.
Location
src/app/middlewares/auth.tsauth()middlewareHow to Fix
Extract and validate the Bearer token properly:
Acceptance Criteria