fix(auth): dedupe concurrent session expiry
This commit is contained in:
@@ -90,7 +90,7 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const requestInit = token ? { ...init, headers: withAuthorization(init?.headers, token) } : init;
|
||||
const response = await fetch(path, requestInit);
|
||||
if (!response.ok) {
|
||||
if (response.status === 401 && token && path !== '/api/v2/session') notifyUnauthorizedSession();
|
||||
if (response.status === 401 && token && path !== '/api/v2/session') notifyUnauthorizedSession(token);
|
||||
throw new Error(await responseErrorMessage(response));
|
||||
}
|
||||
const envelope = (await response.json()) as ApiEnvelope<T>;
|
||||
|
||||
Reference in New Issue
Block a user