-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
router.reset() doesn't clear the PipelineProvider #465
Comments
Hi @EisenbergEffect |
Thank you so much for discovering this @arnederuwe. I have been thinking that I was losing my mind by my auth step being re-triggered. Excited to see what the fix for this will be, but thank you so much for the instruction of how to work around. |
I think this is the right place. I may end up adding an options object to
reset though so it's opt in.
…On Feb 2, 2017 7:37 AM, "Zachary Avery" ***@***.***> wrote:
Thank you so much for discovering this @arnederuwe
<https://github.com/arnederuwe>. I have been thinking that I was losing
my mind by my auth step being re-triggered. Excited to see what the fix for
this will be, but thank you so much for the instruction of how to work
around.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#465 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIBnb3AiX60FYMMkj0xwTUeqT3e3ZSMks5rYfhEgaJpZM4Lz7Yf>
.
|
while we wait on an official pull, this should work for now: import { AppRouter } from 'aurelia-router';
const _reset = AppRouter.prototype.reset;
AppRouter.prototype.reset = function reset(this: any, ...args) {
_reset.call(this, ...args);
if(this.pipelineProvider) {
this.pipelineProvider.reset();
}
} |
Its already in I think. Or at least in one of my hanging PR |
I think it's in here :#637 |
I'm submitting a bug report
1.1.1
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
6.9.1
3.10.8
Browser:
all
Language:
TypeScript 2.1
Current behavior:
When calling aurelia.setRoot(), this function resets the router. This way you can have 2 different route configs in your different app roots without manually having to clear the router when switching app roots. Right now the steps attached to the router remain active, causing bugs with authorisationSteps. I described my specific issue in detail in the following StackOverflow post: http://stackoverflow.com/questions/41956911/router-authorizestep-from-other-app-root-keeps-triggering
Expected/desired behavior:
What is the expected behavior?
an aurelia.setRoot() should also do a pipelineProvider.reset()
Unless i'm missing something, this can even be included in the router.reset() function
What is the motivation / use case for changing the behavior?
It took some searching to figure out why my authorizeStep was still executing in another app root. I don't think the behavior is logical, when you switch roots, you want a whole 'new' router, without any steps you attached in another root.
If this can be fixed by just including the pipelineProvider.reset() into the router.clear() function, I would be happy to make a pull request for it.
The text was updated successfully, but these errors were encountered: