0
votes

Below error I get using hash

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

Things are working fine without hash

After login it tries to read for id_token but it do not gets it since now the url is something like

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

without hash redirect url is

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

How can I solve this issue?

1
On successful login, how are you handling callback url? You need to add some custom logic to handle hash in URLSohan

1 Answers

0
votes

I had similar issue where i need to handle the # in URL.

I was on AngularJS and not angular. But this is pretty much what you might need to do.On successful authentication callback I handled route somethings like this,

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

And my goToAuthComplete is something ,

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

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

            deferred.resolve();

            return deferred.promise;
        }