diff --git a/src/frontend/packages/core/src/app.routing.ts b/src/frontend/packages/core/src/app.routing.ts index 9441eb4583..2020929d92 100644 --- a/src/frontend/packages/core/src/app.routing.ts +++ b/src/frontend/packages/core/src/app.routing.ts @@ -10,6 +10,8 @@ import { PageNotFoundComponentComponent } from './core/page-not-found-component/ import { CustomRoutingImportModule } from './custom-import.module'; import { DashboardBaseComponent } from './features/dashboard/dashboard-base/dashboard-base.component'; import { HomePageComponent } from './features/home/home/home-page.component'; +import { LoginPageComponent } from './features/login/login-page/login-page.component'; +import { LogoutPageComponent } from './features/login/logout-page/logout-page.component'; import { NoEndpointsNonAdminComponent } from './features/no-endpoints-non-admin/no-endpoints-non-admin.component'; import { DomainMismatchComponent } from './features/setup/domain-mismatch/domain-mismatch.component'; import { LocalAccountWizardComponent } from './features/setup/local-account-wizard/local-account-wizard.component'; @@ -40,7 +42,19 @@ const appRoutes: Routes = [ }, { path: 'upgrade', component: UpgradePageComponent }, { path: 'domainMismatch', component: DomainMismatchComponent }, - { path: 'login', loadChildren: () => import('./features/login/login.module').then(m => m.LoginModule) }, + { + path: 'login', + children: [ + { + path: '', + component: LoginPageComponent + }, + { + path: 'logout', + component: LogoutPageComponent + }, + ] + }, { path: '', component: DashboardBaseComponent, diff --git a/src/frontend/packages/core/src/core/extension/extension-service.ts b/src/frontend/packages/core/src/core/extension/extension-service.ts index b43f57a0bf..c2d198c7d6 100644 --- a/src/frontend/packages/core/src/core/extension/extension-service.ts +++ b/src/frontend/packages/core/src/core/extension/extension-service.ts @@ -167,7 +167,8 @@ export class ExtensionService { if (extensionMetadata.loginComponent) { // Override the component used for the login route - const loginRoute = routeConfig.find(r => r.path === 'login') || {}; + const loginRouteRoot = routeConfig.find(r => r.path === 'login') || { children: [] }; + const loginRoute = loginRouteRoot.children.find(c => c.path === ''); loginRoute.component = extensionMetadata.loginComponent; needsReset = true; } diff --git a/src/frontend/packages/core/src/features/login/login.module.ts b/src/frontend/packages/core/src/features/login/login.module.ts index 97aadbe651..64649d97ad 100644 --- a/src/frontend/packages/core/src/features/login/login.module.ts +++ b/src/frontend/packages/core/src/features/login/login.module.ts @@ -3,15 +3,13 @@ import { NgModule } from '@angular/core'; import { CoreModule } from '../../core/core.module'; import { SharedModule } from '../../shared/shared.module'; import { LoginPageComponent } from './login-page/login-page.component'; -import { LoginRoutingModule } from './login.routing'; import { LogoutPageComponent } from './logout-page/logout-page.component'; @NgModule({ imports: [ CoreModule, - SharedModule, - LoginRoutingModule + SharedModule ], declarations: [ LoginPageComponent, diff --git a/src/frontend/packages/core/src/features/login/login.routing.ts b/src/frontend/packages/core/src/features/login/login.routing.ts deleted file mode 100644 index 5b75a930f7..0000000000 --- a/src/frontend/packages/core/src/features/login/login.routing.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -import { LoginPageComponent } from './login-page/login-page.component'; -import { LogoutPageComponent } from './logout-page/logout-page.component'; - -const loginRoutes: Routes = [ - { path: '', component: LoginPageComponent, }, - { path: 'logout', component: LogoutPageComponent, } -]; - -@NgModule({ - imports: [ - RouterModule.forChild(loginRoutes), - ] -}) -export class LoginRoutingModule { }