0

下面的错误我使用哈希

Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'auth-callback/id_token'

没有哈希,一切正常

登录后它尝试读取 id_token 但它没有得到它,因为现在 url 类似于

  • website.com/#/auth-callback/id_token=something.......

没有哈希重定向 url 是

  • website.com/auth-callback/#id_token=something.......

我该如何解决这个问题?

4

1 回答 1

0

我有类似的问题,我需要处理#in URL。

我在 AngularJS 上,而不是 Angular。但这几乎是您可能需要做的。在成功的身份验证回调中,我处理了类似这样的路由,

 private onAuthenticationCallback(deepLinkUrl: string): void
        {
            const params = siteUrl.substr(siteUrl.indexOf("#")); //replace # with actual route??
            this.clientRoutingService.goToAuthComplete(params);
        }

我的goToAuthComplete是一些东西,

public goToAuthComplete(url: string): ng.IPromise<any>
        {
            const deferred = this.$q.defer<any>();

            this.$state.go("authComplete", { path: url });

            deferred.resolve();

            return deferred.promise;
        }
于 2020-06-08T07:00:05.580 回答