MCPcopy
hub / github.com/redpanda-data/console / createAuthInjectingFetch

Function createAuthInjectingFetch

frontend/src/config.ts:100–107  ·  view source on GitHub ↗
(baseFetch: WindowOrWorkerGlobalScope['fetch'])

Source from the content-addressed store, hash-verified

98 */
99export const createAuthInjectingFetch =
100 (baseFetch: WindowOrWorkerGlobalScope['fetch']): WindowOrWorkerGlobalScope['fetch'] =>
101 (input, init) => {
102 const headers = new Headers(init?.headers);
103 if (config.jwt && !headers.has('Authorization')) {
104 headers.set('Authorization', `Bearer ${config.jwt}`);
105 }
106 return baseFetch(input, { ...init, headers });
107 };
108
109/**
110 * Interceptor to handle license expiration errors in gRPC responses.

Callers 2

config.test.tsxFile · 0.90
setConfigFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…