fixed search
This commit is contained in:
@@ -42,6 +42,16 @@
|
||||
headers.set(CORRELATION_HEADER, outgoingCid);
|
||||
}
|
||||
|
||||
// Inject Authorization header if JWT token is available and not already provided
|
||||
try {
|
||||
const storedToken = (window.app && window.app.token) || (typeof localStorage !== 'undefined' && localStorage.getItem('auth_token'));
|
||||
if (storedToken && !headers.has('Authorization')) {
|
||||
headers.set('Authorization', `Bearer ${storedToken}`);
|
||||
}
|
||||
} catch (_) {
|
||||
// Ignore storage access errors (e.g., privacy mode)
|
||||
}
|
||||
|
||||
const requestInit = { ...options, headers };
|
||||
|
||||
const response = await originalFetch(resource, requestInit);
|
||||
|
||||
Reference in New Issue
Block a user