@mundogamernetwork/shared-ui 1.2.8 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/services/campaignService.ts +12 -2
package/package.json
CHANGED
|
@@ -25,8 +25,13 @@ function getMainClient(): AxiosInstance {
|
|
|
25
25
|
typeof location === "undefined" ? "" : location.pathname.split("/")[1] || ""
|
|
26
26
|
const lang = SUPPORTED_LOCALES.includes(seg) ? seg : "en"
|
|
27
27
|
config.params = { ...config.params, lang }
|
|
28
|
+
// Only attach the shared debug token in true local dev — "!== production"
|
|
29
|
+
// also matches "hlg" (staging), which has real logged-in users relying on
|
|
30
|
+
// their own session cookie via withCredentials. Attaching this static
|
|
31
|
+
// token there overrides/corrupts their actual auth, causing a 401 on
|
|
32
|
+
// endpoints that check the request's real identity (e.g. key requests).
|
|
28
33
|
if (
|
|
29
|
-
import.meta.env.VITE_APP_ENV
|
|
34
|
+
import.meta.env.VITE_APP_ENV === "local" &&
|
|
30
35
|
typeof window !== "undefined" &&
|
|
31
36
|
import.meta.env.VITE_BEARER_TOKEN
|
|
32
37
|
) {
|
|
@@ -55,8 +60,13 @@ function getAuthClient(): AxiosInstance {
|
|
|
55
60
|
typeof location === "undefined" ? "" : location.pathname.split("/")[1] || ""
|
|
56
61
|
const lang = SUPPORTED_LOCALES.includes(seg) ? seg : "en"
|
|
57
62
|
config.params = { ...config.params, lang }
|
|
63
|
+
// Only attach the shared debug token in true local dev — "!== production"
|
|
64
|
+
// also matches "hlg" (staging), which has real logged-in users relying on
|
|
65
|
+
// their own session cookie via withCredentials. Attaching this static
|
|
66
|
+
// token there overrides/corrupts their actual auth, causing a 401 on
|
|
67
|
+
// endpoints that check the request's real identity (e.g. key requests).
|
|
58
68
|
if (
|
|
59
|
-
import.meta.env.VITE_APP_ENV
|
|
69
|
+
import.meta.env.VITE_APP_ENV === "local" &&
|
|
60
70
|
typeof window !== "undefined" &&
|
|
61
71
|
import.meta.env.VITE_BEARER_TOKEN
|
|
62
72
|
) {
|