Use browser's history.replaceState() to avoid redirect round trips