Skip to content

Commit

Permalink
Fix log out page when there's a custom log in page (#4467)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox authored Jul 23, 2020
1 parent 67c6d75 commit 43b897a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
16 changes: 15 additions & 1 deletion src/frontend/packages/core/src/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
17 changes: 0 additions & 17 deletions src/frontend/packages/core/src/features/login/login.routing.ts

This file was deleted.

0 comments on commit 43b897a

Please sign in to comment.