Fix history back after a redirect
authorChocobozzz <me@florianbigard.com>
Thu, 24 May 2018 07:44:04 +0000 (09:44 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 24 May 2018 07:44:04 +0000 (09:44 +0200)
client/src/app/core/routing/redirect.service.ts

index a0125e0aea3f550e951ae9dab37c35cac2b2fbdc..abe044d7306e007dbab9ef61084b345fdff0a53e 100644 (file)
@@ -31,7 +31,7 @@ export class RedirectService {
   redirectToHomepage () {
     console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE)
 
-    this.router.navigate([ RedirectService.DEFAULT_ROUTE ])
+    this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true })
       .catch(() => {
         console.error(
           'Cannot navigate to %s, resetting default route to %s.',
@@ -40,7 +40,7 @@ export class RedirectService {
         )
 
         RedirectService.DEFAULT_ROUTE = RedirectService.INIT_DEFAULT_ROUTE
-        return this.router.navigate([ RedirectService.DEFAULT_ROUTE ])
+        return this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true })
       })
 
   }