Skip to content

fix(auth): bypass authentication for CORS preflight requests#358

Open
fGeorjje wants to merge 1 commit intohyperblast:masterfrom
fGeorjje:master
Open

fix(auth): bypass authentication for CORS preflight requests#358
fGeorjje wants to merge 1 commit intohyperblast:masterfrom
fGeorjje:master

Conversation

@fGeorjje
Copy link

  • Allow OPTIONS requests to skip authentication, as browsers are forbidden from sending credentials during a preflight handshake.
  • Move ResponseHeadersFilter before BasicAuthFilter to ensure CORS headers are attached to the response even if authentication fails.

This ensures that browser-based clients can successfully authenticate with the server without being blocked by CORS preflight failures.

Fixes #357

- Allow OPTIONS requests to skip authentication, as browsers are
  forbidden from sending credentials during a preflight handshake.
- Move ResponseHeadersFilter before BasicAuthFilter to ensure
  CORS headers are attached to the response even if authentication
  fails.

This ensures that browser-based clients can successfully
authenticate with the server without being blocked by CORS
preflight failures.

Fixes hyperblast#357
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.

[Bug] CORS preflight (OPTIONS) requests fail when authentication is enabled

1 participant