Skip to content

Reintroduce custom fetch to buildAuthenticatedFetch as an option #3952

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 1 commit into
base: main
Choose a base branch
from

Conversation

mrkvon
Copy link

@mrkvon mrkvon commented May 9, 2025

Feature description

This PR addresses #3810.

Add the optional fetch parameter back to buildAuthenticatedFetch options (second parameter), defaulting to global fetch. This is a non-breaking change.

Usage:

const authFetch = await buildAuthenticatedFetch(accessToken, {
  fetch: customFetch, // optional
  // ...otherOptions
});

Motivation

Custom fetch was removed in v2 of @inrupt/solid-client-authn-core. But buildAuthenticatedFetch is used externally as well, most notably in automated CSS authentication. While not strictly necessary for most use cases, a custom fetch option gives more flexibility (polyfills, logging, tweaking functionality, etc.) when building authenticated fetches.

Checklist

  • All acceptance criteria are met. not found
  • Relevant documentation has been written/updated. JSDoc of the affected method
  • The changelog has been updated, if applicable. the CHANGELOG doesn't seem to track changes to core; will add upon request
  • New functions/types have been exported in index.ts, if applicable. not applicable
  • Commits in this PR are minimal and have descriptive commit messages

Fixes #3810

@mrkvon mrkvon requested a review from a team as a code owner May 9, 2025 11:47
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.

buildAuthenticatedFetch no longer supports custom fetch as a first argument
1 participant