fix: auth post (#627)

Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
Igor Monadical
2025-09-09 16:46:57 -04:00
committed by GitHub
parent 3b85ff3bdf
commit 962038ee3f
2 changed files with 8 additions and 2 deletions

View File

@@ -56,6 +56,8 @@ export const $api = createFetchClient<paths>(client);
let currentAuthToken: string | null | undefined = undefined;
// the function contract: lightweight, idempotent
export const configureApiAuth = (token: string | null) => {
export const configureApiAuth = (token: string | null | undefined) => {
// watch only for the initial loading; "reloading" state assumes token presence/absence
if (token === undefined && currentAuthToken !== undefined) return;
currentAuthToken = token;
};