Element84 / filmdrop-ui

A web UI to search and display results from the FilmDrop STAC API.
Other
23 stars 1 forks source link

Add support for fetching with credentials #385

Closed philvarner closed 5 months ago

philvarner commented 5 months ago

Related Issue(s):

Proposed Changes:

  1. Allow deployer to configure the "credentials" parameter that fetch uses with interacting with the API. This allows The UI to interact with APIs that use the same authentication as the UI, e.g., basic authentication.
  2. Remove unnecessary method: 'GET' parameters

PR Checklist:

bradleyandrick commented 5 months ago

@philvarner code looks good, but I kind of think that the default behavior would be to set it to 'omit'. then opt in via the optional config setting if you need to care about auth? what do you think? non-blocking so approved as is.

philvarner commented 5 months ago

@philvarner code looks good, but I kind of think that the default behavior would be to set it to 'omit'. then opt in via the optional config setting if you need to care about auth? what do you think? non-blocking so approved as is.

I set the default to same-origin because that's what the browser's default is if you don't set it at all, so that not configuring this will result in the same behavior as if it wasn't specified at all.