this.currentUrl = this.router.url
router.events.subscribe(event => {
if (event instanceof NavigationEnd || event instanceof NavigationCancel) {
- if (event.url === '/404') return
+ if ([ '/401', '/404' ].includes(event.url)) return
this.previousUrl = this.currentUrl
this.currentUrl = event.url