Spaces:
Running
Running
Update src/services/horoscopeService.js
Browse files
src/services/horoscopeService.js
CHANGED
|
@@ -33,16 +33,15 @@ export const fetchHoroscopeData = async (category, period) => {
|
|
| 33 |
const headers = {
|
| 34 |
Accept: "application/vnd.github.v3+json",
|
| 35 |
};
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
headers["Authorization"] = `token ${process.env.REACT_APP_GITHUB_TOKEN}`;
|
| 40 |
}
|
| 41 |
|
| 42 |
console.log("Fetching from URL:", url);
|
| 43 |
console.log(
|
| 44 |
"Using token:",
|
| 45 |
-
|
| 46 |
);
|
| 47 |
|
| 48 |
const response = await fetch(url, { headers });
|
|
|
|
| 33 |
const headers = {
|
| 34 |
Accept: "application/vnd.github.v3+json",
|
| 35 |
};
|
| 36 |
+
|
| 37 |
+
if (window?.huggingface?.variables?.REACT_APP_GITHUB_TOKEN) {
|
| 38 |
+
headers["Authorization"] = `token ${window?.huggingface?.variables?.REACT_APP_GITHUB_TOKEN}`;
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
console.log("Fetching from URL:", url);
|
| 42 |
console.log(
|
| 43 |
"Using token:",
|
| 44 |
+
window?.huggingface?.variables?.REACT_APP_GITHUB_TOKEN ? "Yes" : "No"
|
| 45 |
);
|
| 46 |
|
| 47 |
const response = await fetch(url, { headers });
|