导航策略中的Aurelia取消导航

导航策略中的Aurelia取消导航,aurelia,Aurelia,我有一个登录路径,可以将用户重定向到一个外部打开的ID连接登录页面。一旦到了那里,如果用户单击后退按钮,他们就会点击重定向他们的相同路线,从而再次被重定向。有没有办法取消Aurelia的导航或阻止当前路线在历史记录中被记住 config.mapRoute({ name: "login", nav: false, // If I exclude the module id, I get the desired

我有一个登录路径,可以将用户重定向到一个外部打开的ID连接登录页面。一旦到了那里,如果用户单击后退按钮,他们就会点击重定向他们的相同路线,从而再次被重定向。有没有办法取消Aurelia的导航或阻止当前路线在历史记录中被记住

       config.mapRoute({
            name: "login",
            nav: false,

            // If I exclude the module id, I get the desired behavior but errors are thrown from Aurelia.
            moduleId: "components/login/login",

            route: "login",
            navigationStrategy: (instruction: NavigationInstruction) => {

                // This promise constructs the redirect url then sets the window.location.href.
                // Unfortunately, Aurelia seems to be finishing its business before the page is redirected because this login route is recorded in history.
                return this.userManager.signinRedirect();

            }
        });

我知道已经有一段时间了,所以你可能在别处找到了答案,但你可以试试

router.navigate('new url', { replace: true });

我知道已经有一段时间了,所以你可能在别处找到了答案,但你可以试试

router.navigate('new url', { replace: true });