MCPcopy Create free account
hub / github.com/bytebase/bytebase / refreshTokens

Function refreshTokens

frontend/src/connect/refreshToken.ts:14–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 * Only one tab performs the refresh; others wait for completion.
13 */
14export async function refreshTokens(): Promise<void> {
15 // Same-tab deduplication
16 if (localPromise) {
17 return localPromise;
18 }
19
20 localPromise = doRefresh().finally(() => {
21 localPromise = null;
22 });
23
24 return localPromise;
25}
26
27async function doRefresh(): Promise<void> {
28 if (await tryAcquireAndRefresh()) {

Callers 4

reconnectFunction · 0.90
callApiFunction · 0.90
authInterceptorFunction · 0.90

Calls 1

doRefreshFunction · 0.85

Tested by

no test coverage detected