fix: more login/session issues addressed
This commit is contained in:
parent
cf46450f5f
commit
ee152a514c
8 changed files with 85 additions and 51 deletions
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue