Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Add VITE_GIS_TOKEN to the image service request" #62

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ jobs:
GOOGLE_TAG_MANAGER_ID: ${{secrets.GOOGLE_TAG_MANAGER_ID}}
GOOGLE_TAG_AUTH: ${{secrets.GOOGLE_TAG_AUTH}}
GOOGLE_TAG_PREVIEW: ${{secrets.GOOGLE_TAG_PREVIEW}}
VITE_GIS_TOKEN: {{secrets.GIS_TOKEN}}
VITE_REFERER: {{vars.GIS_REFERER}}
run: |
npm install
npm run build
Expand Down
10 changes: 1 addition & 9 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@ export const handleImageServiceRequest = async (event, variable, setChartData, s
};

try {
const token = import.meta.env.VITE_GIS_TOKEN ?? '';
const referer = import.meta.env.VITE_REFERER ?? 'https://earth.gov';
const response = await fetch(url.toString(), {
method: 'GET',
headers: {
'X-Esri-Authorization': `Bearer ${token}`,
'Referer': `${referer}`,
}
});
const response = await fetch(url.toString(), { method: 'GET' });
const results = await response.json();
// const results = mockData; // Uncomment this line to use mockData during testing

Expand Down