MCPcopy Index your code
hub / github.com/MoonshotAI/kimi-code / authToken

Function authToken

apps/vis/web/src/api.ts:50–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50function authToken(): string | null {
51 if (typeof window === 'undefined') return null;
52 const fromHash = readTokenParam(window.location.hash);
53 const fromSearch = readTokenParam(window.location.search);
54 const token = fromHash ?? fromSearch;
55 if (token !== null && token.length > 0) {
56 window.localStorage.setItem(TOKEN_STORAGE_KEY, token);
57 scrubTokenFromUrl();
58 return token;
59 }
60 return window.localStorage.getItem(TOKEN_STORAGE_KEY);
61}
62
63async function request<T>(path: string, method: 'GET' | 'POST' | 'DELETE'): Promise<T> {
64 const headers: Record<string, string> = { accept: 'application/json' };

Callers 2

requestFunction · 0.85
api.tsFile · 0.85

Calls 4

readTokenParamFunction · 0.85
scrubTokenFromUrlFunction · 0.85
setItemMethod · 0.65
getItemMethod · 0.65

Tested by

no test coverage detected