Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
fun signInOrSignUpWithEnteredCredential(activity: Activity, username: String, password: String) {
viewModelScope.launch {
val signInSuccess = true
//do some sign in or sign up logic here
// signInSuccess = doSomeSignInOrSignUpWork(username, password)
//then if successful...
if (signInSuccess) {
//Set signedInPasswordCredential - this is a flag to indicate to the UI that we're now
//signed in.
signedInPasswordCredential.value = PasswordCredential(username, password)
//...And offer to the user to save the credential to the store.
saveCredential(activity, username, password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment