feat(B3): wire X-Tenant-ID header interceptor in axios client
Reads schaeffler_tenant_id from localStorage and injects it as X-Tenant-ID header for all API requests (admin cross-tenant view). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@ const api = axios.create({
|
||||
api.interceptors.request.use((config) => {
|
||||
const token = useAuthStore.getState().token
|
||||
if (token) config.headers.Authorization = `Bearer ${token}`
|
||||
const tenantId = localStorage.getItem('schaeffler_tenant_id')
|
||||
if (tenantId) config.headers['X-Tenant-ID'] = tenantId
|
||||
return config
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user