Android navigation component- With Login screens

I think the first approach is better. To hide the 'back' button on your toolbar inside signUpFragment you can use AppBarConfiguration, and customize which destinations are considered top-level destinations. For example:

val appBarConfiguration = AppBarConfiguration.Builder(setOf(R.id.home_fragment, R.id.signUpFragment_dest)).build()
NavigationUI.setupWithNavController(toolbar, navController, appBarConfiguration)

This way home_fragment and signUpFragment_dest will be considered top-level destinations, and won't have back button on toolbar.