Skip to content

Commit

Permalink
Merge pull request #318 from RENCI/issue-310-secure-token
Browse files Browse the repository at this point in the history
adding security token usage
  • Loading branch information
lstillwe authored Oct 29, 2024
2 parents 04d3bf2 + a0ccaf4 commit d6ea355
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/dialog/observation-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Typography } from '@mui/material';
import axios from 'axios';
import axiosRetry from 'axios-retry';
import { LineChart, Line, XAxis, YAxis, CartesianGrid, ResponsiveContainer, Tooltip, ReferenceLine } from 'recharts';

import { getNamespacedEnvParam } from "@utils/map-utils";
import dayjs from 'dayjs';


// install day.js for UTC visual formatting
const utc = require("dayjs/plugin/utc");

Expand Down Expand Up @@ -56,10 +57,16 @@ function getObsChartData(url, setLineButtonView) {

// create the function to call for data
queryFn: async () => {
// create the authorization header
const requestOptions = {
method: 'GET',
headers: { Authorization: `Bearer ${ getNamespacedEnvParam('REACT_APP_UI_DATA_TOKEN') }`}
};

// make the call to get the data
const ret_val = await axios
// make the call to get the data
.get(url)
.get(url, requestOptions)
// use the data returned
.then (( response ) => {
// return the data
Expand Down

0 comments on commit d6ea355

Please sign in to comment.