Conditional Landing Page after Login

Has anyone made their app direct a user to a certain page based on collection information? How did you accomplish this?

In my app, I have a LessonsPage and a CoursesPage. I would like to have the user sent to the CoursesPage if they have no courses and then if they have courses, they should always be sent to the LessonsPage.

I’ve attempted to get this to redirect in a container, which does work, but then the issue is that if a user wants to go to the LessonsPage (without having created a class), they can’t. The reason they can’t is because the container keeps redirecting them back to the CoursesPage.

Yeah, in our app you can create different roles for users, and assign a startpage depending on role. What I did though is that the login screen is not a route, but is shown depending on if the user is logged in or not. This also makes it so that if you go to app.com/route, and you’re not logged in, after you’ve logged in you’ll be on the page you wanted.

We have role based landing pages as well. This works fine. I’ll probably borrow your idea of turning the login page into a non-route, since I do want that functionality.

Our main issue is using data from other collections. That complicates things because it requires another subscription, but I don’t want that to add too much loading time. Plus I still want to allow the user to click to other pages.