공식문서: https://firebase.google.com/docs/auth/android/password-auth?hl=ko
//회원가입 + 로그인됨
auth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
Toast.makeText(this, "성공!!", Toast.LENGTH_SHORT).show()
} else {
Toast.makeText(this, "실패!!", Toast.LENGTH_SHORT).show()
}
}
//로그아웃
auth.signOut()
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
Toast.makeText(this, "성공!!", Toast.LENGTH_SHORT).show()
} else {
Toast.makeText(this, "실패!!", Toast.LENGTH_SHORT).show()
}
}