+ if (this.previousUrl) {
+ const isException = exceptions.find(e => this.previousUrl.startsWith(e))
+ if (!isException) return this.router.navigateByUrl(this.previousUrl)
+ }
+
+ return this.redirectToHomepage()
+ }
+
+ redirectToHomepage (skipLocationChange = false) {
+ if (this.redirectingToHomepage) return
+
+ this.redirectingToHomepage = true
+
+ console.log('Redirecting to %s...', this.defaultRoute)
+
+ this.router.navigateByUrl(this.defaultRoute, { skipLocationChange })
+ .then(() => this.redirectingToHomepage = false)