I am using Iron Router in a fairly complex app and have some routes that redirect users to other internal routes (for example, "/"
always redirects to "/dashboard"
).
We have been dealing with this by just adding e.g. Router.go("/dashboard")
, or (confusingly but equally ineffective) this.redirect("/dashboard")
to the first route's action
hook.
The problem is that this breaks the browser's back button: you fleetingly land back on the route that has the redirect action, which then redirects you right back to where you were.
history.state
by default for this.redirect()
?For anyone still wondering, a fix for this issue is scheduled for the next release of Iron Router: https://github.com/EventedMind/iron-router/issues/764
There you will be able to use this.redirect() from within your route hooks, which will replace the state by default