fix: more login/session issues addressed

This commit is contained in:
Andy Burke 2025-07-04 15:16:51 -07:00
parent cf46450f5f
commit ee152a514c
8 changed files with 85 additions and 51 deletions

View file

@ -11,8 +11,8 @@ const api = {
const headers = {
Accept: "application/json",
"x-session_id": session_id,
"x-totp": await otp_totp(session_secret),
"x-session_id": session_id ?? "",
"x-totp": session_secret ? await otp_totp(session_secret) : "",
...(options.headers ?? {}),
};
@ -26,7 +26,7 @@ const api = {
fetch_options.body = JSON.stringify(options.json);
}
const response = await fetch(`/api${url}`, fetch_options);
const response = await fetch(url, fetch_options);
return response;
},