This commit is contained in:
Bastian Wagner
2026-07-15 14:31:56 +02:00
parent 3e5348b7ec
commit 0fd85573d2
11 changed files with 128 additions and 14 deletions

View File

@@ -19,6 +19,14 @@ import { VerifyEmailComponent } from './app/pages/verify-email.component';
import { API_BASE_URL } from './app/shared/api-base-url';
import { AuthService } from './app/shared/auth.service';
declare global {
interface Window {
__LDAP_PORTAL_CONFIG__?: {
apiBaseUrl?: string;
};
}
}
const authInterceptor: HttpInterceptorFn = (request, next) => {
const token = localStorage.getItem('accessToken');
if (!token) {
@@ -58,6 +66,6 @@ bootstrapApplication(AppComponent, {
provideRouter(routes),
provideHttpClient(withInterceptors([authInterceptor])),
AuthService,
{ provide: API_BASE_URL, useValue: 'http://localhost:3000' },
{ provide: API_BASE_URL, useValue: window.__LDAP_PORTAL_CONFIG__?.apiBaseUrl ?? 'http://localhost:3000' },
],
}).catch((error) => console.error(error));