When I click the login button provided in the quickstart I get this error after a redirect from the /implicit/callback route:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'code'
Error: Cannot match any routes. URL Segment: 'code'
at ApplyRedirects.push../node_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:2459)
at CatchSubscriber.selector (router.js:2440)
at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchSubscriber.error (catchError.js:34)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at ThrowIfEmptySubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at resolvePromise (zone.js:836)
at resolvePromise (zone.js:795)
at zone.js:897
at ZoneDelegate.invokeTask (zone.js:431)
at Object.onInvokeTask (core.js:26246)
at ZoneDelegate.invokeTask (zone.js:430)
at Zone.runTask (zone.js:198)
at drainMicroTaskQueue (zone.js:611)
I’m not testing this in a new empty app, it will be my next step to see if it also occurs in an empty project, strictly following the quickstart guide, but what could be the issue here? Nowhere in my project do I refer to any ‘code’ paths and it seems to happen during the process that I import straight from OktaAuthModule.
I’ve made a StackBlitz example that reproduces the issue https://stackblitz.com/edit/angular-5bkkhr (just plug your credentials in the config in app.module.ts). I accept any and all symbolic rewards such as badges and bragging rights for my find. In absence of any such swagger my next bug report will go no further than: “it no worky worky, plz help”.
The stackblitz doesn’t work when you try it through the preview panel on the right but it will work if you visit the stackblitz’s standalone page.
This was a real pain in the butt!! But, I have a bare bones working example of how to resolve this issue available on github. You need to intercept the route via CanActivate and use @okta/okta-auth-js tokenManager instead of @okta/okta-angular CallbackComponent.
If my github repo saved your life (or maybe your day/week) please star it
Results in an error: This expression is not callable.
Type ‘typeof import(“c:/Repos/Ui/node_modules/@okta/okta-auth-js/lib/browser/index”)’ has no call signatures.ts(2349)