1
0
mirror of https://github.com/google/nomulus synced 2026-01-05 04:56:03 +00:00

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.
This commit is contained in:
gbrodman
2023-09-15 12:28:04 -04:00
committed by GitHub
parent 2713a10a07
commit a65e85f9e1
2 changed files with 4 additions and 2 deletions

View File

@@ -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',

View File

@@ -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 }]);
}
}