New enterprise feature
This commit is contained in:
@@ -102,6 +102,9 @@ class ApiClient {
|
||||
// Only add auth token for non-public endpoints
|
||||
if (this.authToken && !isPublicEndpoint) {
|
||||
config.headers.Authorization = `Bearer ${this.authToken}`;
|
||||
console.log('🔑 [API Client] Adding Authorization header for:', config.url);
|
||||
} else if (!isPublicEndpoint) {
|
||||
console.warn('⚠️ [API Client] No auth token available for:', config.url, 'authToken:', this.authToken ? 'exists' : 'missing');
|
||||
}
|
||||
|
||||
// Add tenant ID only for endpoints that require it
|
||||
@@ -343,7 +346,9 @@ class ApiClient {
|
||||
|
||||
// Configuration methods
|
||||
setAuthToken(token: string | null) {
|
||||
console.log('🔧 [API Client] setAuthToken called:', token ? `${token.substring(0, 20)}...` : 'null');
|
||||
this.authToken = token;
|
||||
console.log('✅ [API Client] authToken is now:', this.authToken ? 'set' : 'null');
|
||||
}
|
||||
|
||||
setRefreshToken(token: string | null) {
|
||||
|
||||
Reference in New Issue
Block a user