From a65e85f9e17d36e2d350a74908cd65ec97384285 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Fri, 15 Sep 2023 12:28:04 -0400 Subject: [PATCH] Don't include a nextUrl when accessing the console homepage (#2149) In this case we should just display the standard page, no need to redirect anywhere since there's nothing to redirect to. --- console-webapp/src/app/registrar/emptyRegistrar.component.ts | 3 ++- console-webapp/src/app/registrar/registrar.guard.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/console-webapp/src/app/registrar/emptyRegistrar.component.ts b/console-webapp/src/app/registrar/emptyRegistrar.component.ts index 742999de6..f22e66cef 100644 --- a/console-webapp/src/app/registrar/emptyRegistrar.component.ts +++ b/console-webapp/src/app/registrar/emptyRegistrar.component.ts @@ -14,9 +14,10 @@ import { Component } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { RegistrarService } from './registrar.service'; import { Subscription } from 'rxjs'; +import { RegistrarService } from './registrar.service'; + @Component({ selector: 'app-empty-registrar', templateUrl: './emptyRegistrar.component.html', diff --git a/console-webapp/src/app/registrar/registrar.guard.ts b/console-webapp/src/app/registrar/registrar.guard.ts index f0dd9869a..b0d87195a 100644 --- a/console-webapp/src/app/registrar/registrar.guard.ts +++ b/console-webapp/src/app/registrar/registrar.guard.ts @@ -31,7 +31,8 @@ export class RegistrarGuard { return true; } // Get the full URL including any nested children (skip the initial '#/') - const nextUrl = location.hash.split('#/')[1]; + // NB: an empty nextUrl takes the user to the home page + const nextUrl = location.hash.split('#/')[1] || ''; return this.router.navigate([`/empty-registrar`, { nextUrl }]); } }