Closed utipe closed 3 years ago
Maybe it helps, but i just had a similar case and in your case, if profile page is one of the "states" in your authentication flow then you will have a ProfilePage and this one will return a new FlowBuilder that will have X state. Hope it helps!
I am a newbie and I just had a similar case:
So what is the best way for this case?
Thank you!
Maybe @felangel can correct me, but in your case I would have one top level FlowBuilder as you mentioned just checking the authentication. If authenticated you will have your HomePageRouter or something similar that will guide to every of your features. Usually what i do is define some steps(could be an enum, or could be a model) and depends of the route i will change that model/enum so your HomePageRoutter can handle the different routes. If the authentication state changes, as you have a FlowBuilder on top of that, no matter what will have "preference" and will route to login page if needed.
Hi @utipe 👋 Thanks for opening an issue!
As @omartinma mentioned, I'd recommend having a single FlowBuilder that reacts to changes in the Authentication State and you can have nested FlowBuilders for subsequent flows. I don't recommend combining them into a single flow as that will get bloated and become difficult to test/maintain. Hope that helps 👍
Thank you for all your comments! That definitely helps me a lot! I guess I can close this issue for now.
I just started learning how to use this (very useful) package and have a question relating to its usage: Suppose my app has multiple flows e.g. authentication flow then profile flow etc., how should I handle combining these flows together? Should I just add the profile flow on top of the authentication flow?
Thank you!