Cookie auth: credentials:'include' для всех fetch

This commit is contained in:
root 2026-08-20 21:50:26 +00:00
parent f9d54ae65c
commit ae652e37f5

View File

@ -63,7 +63,8 @@ async function api(path, opts = {}, _retry = 0) {
const tid = setTimeout(() => controller.abort(), 15000);
const t0 = Date.now();
try {
r = await fetch(API_BASE + path, { ...o, signal: controller.signal });
// credentials:'include' — браузер шлёт cookies (HttpOnly buhapp_at)
r = await fetch(API_BASE + path, { ...o, credentials: 'include', signal: controller.signal });
} catch (networkErr) {
clearTimeout(tid);
const ms = Date.now() - t0;