My app uses Firebase authentication and I'm implementing a typical sign-in screen with buttons to sign in with Google, email etc. It's surprisingly difficult. I have a LocalUser class to hold the user's profile (name, email etc), state (whether they're logged in or in the process of logging in etc), and provide methods to start the process when a button is clicked. This seems like an ideal candidate for a ViewModel.
The trouble is, ViewModels mustn't hold a reference to an Activity, but the Google Identity SDK needs such a reference as part of its mechanism for providing its result to my code. I can't think of a way to decouple the ViewModel that doesn't still leave the ViewModel referencing the Activity, albeit indirectly.
Is it OK to just remove the ViewModel inheritance from my LocalUser class and pass it directly to my sign in screen (and from there to each control that needs it)? Is it OK for a Composable to hold a reference to Activity?