- redirectToPreviousRoute () {
- if (this.previousUrl) return this.router.navigateByUrl(this.previousUrl)
+ getDefaultRoute () {
+ return this.defaultRoute
+ }
+
+ getDefaultTrendingAlgorithm () {
+ return this.defaultTrendingAlgorithm
+ }
+
+ getPreviousUrl () {
+ return this.previousUrl
+ }
+
+ redirectToPreviousRoute (fallbackRoute?: string) {
+ const exceptions = [
+ '/verify-account',
+ '/reset-password'
+ ]
+
+ if (this.previousUrl && this.previousUrl !== '/') {
+ const isException = exceptions.find(e => this.previousUrl.startsWith(e))
+ if (!isException) return this.router.navigateByUrl(this.previousUrl)
+ }
+
+ if (fallbackRoute) {
+ return this.router.navigateByUrl(fallbackRoute)
+ }