@entropy-softworks/ui 2026.8.30 → 2026.8.31
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-fetch.d.ts","sourceRoot":"","sources":["../../src/utils/api-fetch.ts"],"names":[],"mappings":"AAuBA;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,WAAgB,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"api-fetch.d.ts","sourceRoot":"","sources":["../../src/utils/api-fetch.ts"],"names":[],"mappings":"AAuBA;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,WAAgB,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,CAAC,CA0CnB"}
|
package/lib/utils/api-fetch.js
CHANGED
|
@@ -47,6 +47,24 @@ export async function apiFetch(path, init = {}, timeoutMs) {
|
|
|
47
47
|
if (token) {
|
|
48
48
|
headers.set("Authorization", `Bearer ${token}`);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
// Explicit `credentials: "omit"` — native auth is Bearer-only, and the
|
|
51
|
+
// server's CSRF middleware branches purely on whether a session cookie
|
|
52
|
+
// is PRESENT on the request (see server/src/auth/middleware.rs's
|
|
53
|
+
// csrf_protect: any request carrying the session cookie is treated as
|
|
54
|
+
// cookie-auth and required to also carry a matching X-CSRF-Token +
|
|
55
|
+
// Origin, neither of which this native branch ever sends). React
|
|
56
|
+
// Native's Android fetch persists Set-Cookie responses in a shared
|
|
57
|
+
// CookieManager and reattaches them to matching-origin requests
|
|
58
|
+
// regardless of the web `credentials` semantics being followed
|
|
59
|
+
// elsewhere — so if the server ever sets a session cookie as a side
|
|
60
|
+
// effect for a native client (e.g. during passkey/WebAuthn login,
|
|
61
|
+
// which can involve a system browser or Credential Manager sheet),
|
|
62
|
+
// every subsequent native mutation silently starts requiring CSRF
|
|
63
|
+
// headers it can never provide, failing with "Missing CSRF header".
|
|
64
|
+
// Reported as folder-creation failing this way, 2026-08-17 — but the
|
|
65
|
+
// same stray cookie would affect ANY mutating request once present,
|
|
66
|
+
// not just this one. Omitting credentials here is the actual fix:
|
|
67
|
+
// native should never send or rely on cookies at all.
|
|
68
|
+
return fetchWithTimeout(url, { ...init, headers, credentials: "omit" }, timeoutMs);
|
|
51
69
|
}
|
|
52
70
|
//# sourceMappingURL=api-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-fetch.js","sourceRoot":"","sources":["../../src/utils/api-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,kBAAkB,CA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OAAO,gBAAgB,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;AACrF,CAAC"}
|
package/package.json
CHANGED
package/src/utils/api-fetch.ts
CHANGED
|
@@ -57,5 +57,23 @@ export async function apiFetch(
|
|
|
57
57
|
if (token) {
|
|
58
58
|
headers.set("Authorization", `Bearer ${token}`);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
// Explicit `credentials: "omit"` — native auth is Bearer-only, and the
|
|
61
|
+
// server's CSRF middleware branches purely on whether a session cookie
|
|
62
|
+
// is PRESENT on the request (see server/src/auth/middleware.rs's
|
|
63
|
+
// csrf_protect: any request carrying the session cookie is treated as
|
|
64
|
+
// cookie-auth and required to also carry a matching X-CSRF-Token +
|
|
65
|
+
// Origin, neither of which this native branch ever sends). React
|
|
66
|
+
// Native's Android fetch persists Set-Cookie responses in a shared
|
|
67
|
+
// CookieManager and reattaches them to matching-origin requests
|
|
68
|
+
// regardless of the web `credentials` semantics being followed
|
|
69
|
+
// elsewhere — so if the server ever sets a session cookie as a side
|
|
70
|
+
// effect for a native client (e.g. during passkey/WebAuthn login,
|
|
71
|
+
// which can involve a system browser or Credential Manager sheet),
|
|
72
|
+
// every subsequent native mutation silently starts requiring CSRF
|
|
73
|
+
// headers it can never provide, failing with "Missing CSRF header".
|
|
74
|
+
// Reported as folder-creation failing this way, 2026-08-17 — but the
|
|
75
|
+
// same stray cookie would affect ANY mutating request once present,
|
|
76
|
+
// not just this one. Omitting credentials here is the actual fix:
|
|
77
|
+
// native should never send or rely on cookies at all.
|
|
78
|
+
return fetchWithTimeout(url, { ...init, headers, credentials: "omit" }, timeoutMs);
|
|
61
79
|
}
|