From c335482395690c1ed65ac3a775d0ca4c73eb30e7 Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:10:48 +0100 Subject: [PATCH] Get UI base URL from BE (#744) --- .../autoregistration/autoregistration.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/login-page/autoregistration/autoregistration.component.ts b/src/app/login-page/autoregistration/autoregistration.component.ts index eeeb2a3e4c3..10bc546fb60 100644 --- a/src/app/login-page/autoregistration/autoregistration.component.ts +++ b/src/app/login-page/autoregistration/autoregistration.component.ts @@ -28,7 +28,6 @@ import { getBaseUrl } from '../../shared/clarin-shared-util'; import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; import { RemoteData } from '../../core/data/remote-data'; import { HardRedirectService } from '../../core/services/hard-redirect.service'; -import { environment } from '../../../environments/environment'; /** * This component is showed up when the user has clicked on the `verification token`. @@ -174,7 +173,10 @@ export class AutoregistrationComponent implements OnInit { // Use hard redirect to load all components from the beginning as the logged-in user. Because some components // are not loaded correctly when the user is logged in e.g., `log in` button is still visible instead of // log out button. - this.hardRedirectService.redirect(environment.ui.baseUrl + 'home'); + const redirectUrl = this.baseUrl.endsWith('/') + ? `${this.baseUrl}home` + : `${this.baseUrl}/home`; + this.hardRedirectService.redirect(redirectUrl); } else { this.notificationService.error(this.translateService.instant('clarin.autologin.error.message')); }