ntphuc149 commited on
Commit
796f40d
verified
1 Parent(s): 84687c0

Update src/services/horoscopeService.js

Browse files
Files changed (1) hide show
  1. src/services/horoscopeService.js +4 -5
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
- // Th锚m Authorization header n岷縰 c贸 token
38
- if (process.env.REACT_APP_GITHUB_TOKEN) {
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
- process.env.REACT_APP_GITHUB_TOKEN ? "Yes" : "No"
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 });