I am planning to implement navigation like this:

The problem I face is when us
IMHO how I do it in my app is a little cleaner. Just add these settings in the nav graph:
and then navigate to login via
findNavController().navigate(R.id.action_profile_dest_to_login_dest).
popUpTo and popUpToInclusive close ProfileFragment when we navigate to LoginFragment so if the user navigates back, it exits the app.