mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
Merge pull request #26 from prymitive/fetch-credentials
fix(ui): always pass credentials with fetch()
This commit is contained in:
@@ -72,7 +72,8 @@ const FilterInput = observer(
|
||||
action(({ value }) => {
|
||||
if (value !== "") {
|
||||
this.inputStore.suggestionsFetch = fetch(
|
||||
FormatBackendURI(`autocomplete.json?term=${value}`)
|
||||
FormatBackendURI(`autocomplete.json?term=${value}`),
|
||||
{ credentials: "include" }
|
||||
)
|
||||
.then(
|
||||
result => result.json(),
|
||||
|
||||
@@ -18,9 +18,9 @@ const LabelNameInput = observer(
|
||||
populateNameSuggestions = action(() => {
|
||||
const { matcher } = this.props;
|
||||
|
||||
this.nameSuggestionsFetch = fetch(
|
||||
FormatBackendURI(`labelNames.json`)
|
||||
)
|
||||
this.nameSuggestionsFetch = fetch(FormatBackendURI(`labelNames.json`), {
|
||||
credentials: "include"
|
||||
})
|
||||
.then(
|
||||
result => result.json(),
|
||||
err => {
|
||||
@@ -43,7 +43,10 @@ const LabelNameInput = observer(
|
||||
const { matcher } = this.props;
|
||||
|
||||
this.valueSuggestionsFetch = fetch(
|
||||
FormatBackendURI(`labelValues.json?name=${matcher.name}`)
|
||||
FormatBackendURI(`labelValues.json?name=${matcher.name}`),
|
||||
{
|
||||
credentials: "include"
|
||||
}
|
||||
)
|
||||
.then(
|
||||
result => result.json(),
|
||||
|
||||
@@ -199,7 +199,7 @@ class AlertStore {
|
||||
FormatBackendURI("alerts.json?") +
|
||||
FormatAPIFilterQuery(this.filters.values.map(f => f.raw));
|
||||
|
||||
return fetch(alertsURI)
|
||||
return fetch(alertsURI, { credentials: "include" })
|
||||
.then(result => result.json())
|
||||
.then(result => {
|
||||
return this.parseAPIResponse(result);
|
||||
|
||||
Reference in New Issue
Block a user