I'd like to "free" one nested route, so that also users who are not even logged in can access this route.
For example:
posts
- /create
- /edit
- /show
On the posts route I used the AuthenticatedRouteMixin.
With this, all sub routes are automatically protected. Now I only want to make /show accessable. I know that I could use a mixin on /create and /edit and remove it from posts route, but if you have 10+ nested routes and only 1 of them should be available also for not logged in users, it's kind of inconvenient.
Do you know any other solution to that challenge?
If not, I think I have to write an additional mixin for that...
Thanks!
ember-simple-auth's AuthenticatedRouteMixin uses beforeModel hook to check whether session.isAuthenticated or not. You need to override the beforeModel in 'show' route to either skip the Auth check by bypassing AuthenticatedRouteMixin's super() implementation all together.
Check if the 'show' beforeModel has dependency with parent route .i.e 'posts', implement this check at the parent route.