Merge pull request #26 from prymitive/fetch-credentials

fix(ui): always pass credentials with fetch()
This commit is contained in:
Łukasz Mierzwa
2018-09-15 13:44:21 +01:00
committed by GitHub
3 changed files with 10 additions and 6 deletions

View File

@@ -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(),

View File

@@ -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(),

View File

@@ -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);