-
-
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
Dynamic routes only set when page is refreshed #426
Comments
I can't really tell based on these fragments. We need a running sample that demonstrates this. It doesn't sound like your configuration is happening in time. Can you create a simplest possible reproduction? |
Sure, @EisenbergEffect . Here it is: https://github.com/LeoNero/aurelia-router-issue P.S: to login, go to route #/admin and use any user and password. You'll see that you have to refresh the page and reload the aurelia, because |
@EisenbergEffect Do you have any idea what can be done to solve the problem? |
@LeoNero @guivr Though this doesn't directly solve the issue here, I highly recommending going a different direction for the authentication case. Since a login page is for all intents and purposes both different and separate from your main application page, I recommend implementing your login page as a completely different root. I've written a blog post about this here: http://davismj.me/blog/aurelia-login-best-practices-pt-1/ |
Maybe can be closed |
I'm submitting a bug report
"aurelia-router": "npm:aurelia-router@^1.0.0-beta.1.1.1",
Please tell us about your environment:
OSX 10.10.4 & Linux Ubuntu
5.2.0
3.3.12
JSPM 0.16.15
Chrome 54.0.2840.59 (64 bit)
ESNext
Current behavior:
I'm trying to use dynamic router configuration. I have the following files:
adminRoutes.js:
app.js
app.router.config.js
When this.router.navigateToRoute('geral', {}, {replace: true}); is called, I get the following error:
aurelia-router.js:854 Uncaught (in promise) Error: A route with name 'geral' could not be found. Check thatname: 'geral'was specified in the route's config.(…)generate @ aurelia-router.js:854navigateToRoute @ aurelia-router.js:831(anonymous function) @ app.js:64
user.role verification is ok and
config.map(adminRouters)
is set after authentication.The problem is that admin routes are only properly set if I refresh the page.
console.log(this.router.routes);
I already tried to get support on gitter (3 times) but no one knows why this is happening.
The only temporary solution I have is to do
location.reload()
so the routes can be refreshed.The text was updated successfully, but these errors were encountered: