This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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