0

I have app using firebase by kotlin I want change/update password in Account I use this code but don't success change password

val user = FirebaseAuth.getInstance().currentUser

            user!!.updatePassword(editTextPassword.text.toString().trim()).addOnCompleteListener { task ->
                if (task.isSuccessful) {
                    println("Update Success")
                } else {
                    println("Erorr Update")
                }
            }
1

1 Answer 1

0

https://firebase.google.com/docs/auth/android/manage-users#set_a_users_password

Important: To set a user's password, the user must have signed in recently.

Also, try using this:

val user = FirebaseAuth.getInstance().currentUser
val txtNewPass = editTextPassword.text

user!!.updatePassword(txtNewPass).addOnCompleteListener { task ->
    if (task.isSuccessful) {
        println("Update Success")
    } else {
        println("Error Update")
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.