Skip to content

feat(http): add credentials support for fetch requests in httpResource #62390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SkyZeroZx
Copy link
Contributor

Currently, Angular's httpResource does not expose the credentials option from the underlying Fetch API.

Exposing this option would allow developers to explicitly control how cookies, authorization headers, and TLS client certificates are handled in cross-origin requests, aligning with security requirements and enabling better integration with external APIs.

New usage

httpResource(() => ({
  url: '${ANOTHER_DOMAIN}/api/register',
  method: 'POST',
  credentials: 'include'
}));

This commit adds support for the Fetch API's credentials option when using httpResource with the withFetch provider
@pullapprove pullapprove bot requested a review from alxhub July 1, 2025 01:11
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: common/http Issues related to HTTP and HTTP Client labels Jul 1, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 1, 2025
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

reviewed-for: fw-general, public-api

@thePunderWoman thePunderWoman removed the request for review from alxhub July 1, 2025 08:30
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Jul 1, 2025
@thePunderWoman thePunderWoman requested review from crisbeto and removed request for alxhub, atscott and pkozlowski-opensource July 1, 2025 09:37
@pullapprove pullapprove bot requested review from alxhub and devversion July 1, 2025 09:37
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: common/http Issues related to HTTP and HTTP Client detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants