Skip to content

Commit e53b815

Browse files
jjonektorkelo
authored andcommitted
Enable "With Credentials" for InfluxDB datasource (grafana#6018)
1 parent 52dc2db commit e53b815

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

public/app/plugins/datasource/influxdb/datasource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default class InfluxDatasource {
1616
name: string;
1717
database: any;
1818
basicAuth: any;
19+
withCredentials: any;
1920
interval: any;
2021
supportAnnotations: boolean;
2122
supportMetrics: boolean;
@@ -33,6 +34,7 @@ export default class InfluxDatasource {
3334
this.name = instanceSettings.name;
3435
this.database = instanceSettings.database;
3536
this.basicAuth = instanceSettings.basicAuth;
37+
this.withCredentials = instanceSettings.withCredentials;
3638
this.interval = (instanceSettings.jsonData || {}).timeInterval;
3739
this.supportAnnotations = true;
3840
this.supportMetrics = true;
@@ -187,6 +189,9 @@ export default class InfluxDatasource {
187189
};
188190

189191
options.headers = options.headers || {};
192+
if (this.basicAuth || this.withCredentials) {
193+
options.withCredentials = true;
194+
}
190195
if (self.basicAuth) {
191196
options.headers.Authorization = self.basicAuth;
192197
}

0 commit comments

Comments
 (0)