Skip to content

fix(auth): return clear error on missing auth header and handle configurable tus sign path - #1342

Open
Adityakk9031 wants to merge 1 commit into
supabase:masterfrom
Adityakk9031:fix/tus-signed-upload-error
Open

fix(auth): return clear error on missing auth header and handle configurable tus sign path#1342
Adityakk9031 wants to merge 1 commit into
supabase:masterfrom
Adityakk9031:fix/tus-signed-upload-error

Conversation

@Adityakk9031

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix / Developer Experience improvement

What is the current behavior?

Closes #1268

  1. When a client sends a request to an authenticated endpoint without an Authorization header, the JWT authentication plugin (src/http/plugins/jwt.ts) extracted an empty string "" and attempted to verify it with jose.jwtVerify. This caused jose to throw an internal JWSInvalid: Invalid Compact JWS parsing error instead of an explicit error indicating that the authorization header is missing.
  2. In src/http/routes/tus/lifecycle.ts, the signed URL check was hardcoded to /upload/resumable/sign rather than using the configured tusPath and SIGNED_URL_SUFFIX constants.

What is the new behavior?

  1. jwtPlugin now checks for missing jwt and returns ERRORS.AccessDenied('Missing authorization header') instead of querying the database for JWT secrets and invoking verifyJWT with an empty string.
  2. lifecycle.ts uses tusPath and SIGNED_URL_SUFFIX constants to support configured TUS URL paths in addition to the default /upload/resumable/sign.

@Adityakk9031
Adityakk9031 requested a review from a team as a code owner August 22, 2026 18:14
@Adityakk9031

Adityakk9031 commented Aug 22, 2026

Copy link
Copy Markdown
Author

@ferhatelmas have a look

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.

Local Storage TUS rejects signed upload token generated by the same stack with "Invalid Compact JWS"

1 participant