Wouldn't it be better to just route the location to root of the server? `window.location.replace("/");`