Skip to content

Instantly share code, notes, and snippets.

@theanilpaudel
Created June 15, 2022 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theanilpaudel/9a3b4ecef3219dbadfa8036548e1a8fb to your computer and use it in GitHub Desktop.
Save theanilpaudel/9a3b4ecef3219dbadfa8036548e1a8fb to your computer and use it in GitHub Desktop.
LoginActivity with code for FirebaseAuthentication using email and password
bLogin.setOnClickListener {
Timber.d("email %s and password %s", email, password)
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this@LoginActivity) { task ->
if (task.isSuccessful) {
Timber.d("signInWithEmail:success")
val user = auth.currentUser
updateUI(user)
} else {
task.exception?.printStackTrace()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment