override fun onPause() { // Don't redirect if the user is navigating to the credit card editor fragment. redirectToReAuth( listOf(R.id.creditCardEditorFragment), findNavController().currentDestination?.id, R.id.creditCardsManagementFragment, ) super.onPause() }
When the fragment is paused, navigate back to the settings page to reauthenticate.