Closed jonathaneckman closed 5 years ago
I dont believe the npm link
issue is caused by anything in this plugin. I reproduced similar issues with aurelia-validation. I submitted an issue to JavaScriptServices.
@shaunluttin I stepped through this again. The problem is that the routes do not have a module id. I can see that when attempting to load the logInRedirectCallback
navigation instruction, the viewPortPlan.config.moduleId
is undefined.
Starting in the navigation pipeline:
Then attempting to load the route:
Which tries to load a component based on the module id. In aurelia-path
the error is thrown because of the call to trim
an undefined parameter.
I think the fix is simple. A module id needs to be added to the login and logout routes you are configuring in configureRouter
.
I am using the route names from your example: signin-oidc
and signout-oidc
. This error is thrown whether I have configured these routes in my app or not. For example:
{
route: 'signout-oidc',
name: 'signout-oidc',
moduleId: PLATFORM.moduleName('../../routes/signout-oidc/signout-oidc'),
},
I put together a repro . You can the issue in my configureRouter.
Waiting to see if this is a bug in aurelia-router
or if it should be a change here. See this issue there for more info.
You did a ton a research looking in to that and even uploaded screenshots. Thank you for the report!
I have been away from this project for about a month now and am not sure when I will be returning to it.
From quickly reviewing your analysis, it seems that the fix might be simple but also that it might be a bug in the Aurelia router.
I would be happy to hear more about this and will check-in from time to time.
Sounds good. I have a feature and a blog post waiting on this issue so I'm motivated to help. I plan to showcase this plugin in the post. If the fix is here, are you willing to accept a PR?
Yes. I am definitely willing to accept a PR.
Question: Have you checked out the demo projects? Is the issue there too?
Yes the issue is in the demo projects.
The issue might be related to enhancement https://github.com/shaunluttin/aurelia-open-id-connect/issues/17 that happened with commit https://github.com/shaunluttin/aurelia-open-id-connect/commit/11ea315a8ff741c670e1f33cd332a397aa87efbc.
I was hoping to find some resolution to this issue this with the new release 2.0.0. But i can still confirm the problem even with the demo project. How is this not affecting more users of the plugin? @jonathaneckman Is there a workaround you can suggest?
It is affecting me also.
It's good to know that this remains a problem. I'll mark it as a priority; that said, I am not sure when I will have time to address it.
Hi,
I have looked into this and fount that the problem comes from the way redirects are performed for the signin/signout navigation strategies. This issue comes from the fix introduced by https://github.com/aurelia-contrib/aurelia-open-id-connect/commit/e06a1943e6a4688b0d90f5f8a332b8039a29a216 fixing https://github.com/aurelia-contrib/aurelia-open-id-connect/issues/46.
This is the current sequence when signing in:
Here is the desired sequence when signing in:
instruction.router.history.navigate(redirectRoute, { replace: true });
cc @shaunluttin
We might have resolved this (at least partially) with v2.0.2.
The fix is installed here: https://github.com/aurelia-contrib/aurelia-open-id-connect-demos.
Awesome, Thanks! I'll verify next week
I believe there is a issue related the fixed installed (v2.0.2).
Running version 2.0.2 I am received the error:
After debugging into aurelia-router.js, specifically the _buildNavigationPlan function, I noticed that when returning from identity server the parameter "instruction" (of type NavigationInstruction) was coming through with a "config.redirect" property that contains a value. The value is the url back to the last navigated location of the client application. When _router.generate is called you get an error, because the "newinstruction.config.name" is undefined.
When I remove the "config.redirect" property during debug, I recieved the trim error noted in the screen shot provided by @jonathaneckman.
I set the version back to 2.0.1 and I am no longer seeing errors. I hope that is helpful.
Hi, I will be closing up stale issues by the end of the week.
Are you still experiencing this issue? Feel free to close this yourself. If you are still experiencing this issue, let me know as well, thanks!
I've been tracing this error all week and havent made much progress so I'm hoping you'll see something I dont. After a login redirect, the following happens:
OpenIdConnectNavigationStrategies.signInRedirectCallback
navigation strategy begins.evaluateNavigationStrategy
. I see thatinstruction.config.moduleId
is undefined.OpenIdConnectConfiguration.loginRedirectRoute
.So even though an error is thrown, things seem to be working as expected. Is this a known issue or is this a problem on my end?
I have attempted to clone your plugin to troubleshoot further but get the following error whenever I
npm link
to this project. This is new for me so I may not be doing it right. I am going to keep trying so if you have any insight into how you run the plugin locally to test within a consuming app I'd appreciate it. I think I've guessed the steps to build, run, and test but if you could document those as well it would be a huge help.