First, I have to admit, I’ve had trouble understanding routing beyond the basics. If it’s more complex than one router configured in app.ts to handle the whole site, it’s been hard to wrap my head around.
That said, I want to organize my site as such.
- Forgot Username
- Forgot Password
- Log In
TLDR; Is there an example I can look at that is set up similar to this design?
So far, we’ve had it working with ‘Log In’ being its own root and the authenticated views being under the ‘app’ root. Once authentication was successful, we’d
aurelia.setRoot(PLATFORM.moduleName('app')) and everything was kosher.
Then I needed to add ‘Forgot Username/Password’ to the unauthenticated area. I created a component named ‘unauthenticated’ as home for a new
router-view and configured a router just for it with the ‘Login’ and ‘Forgot’ views.
However, now when it authenticates and
aurelia.setRoot(PLATFORM.moduleName('app') fires and I tell the router to navigate to ‘Home’ it appears to load the files, but the view never changes.
I’ve read a few posts like this one from Foursails (which is what we were doing originally) and this GitHub issue, and tried incorporating
reset(), but I haven’t found the right combination getting it to work.
I feel like this is a major blind-spot in my skill-set and I’m coming up short when I try to understand it.