FirebaseAuth.getInstance().sendPasswordResetEmail(email.toString())
        .addOnCompleteListener { task ->
          if (task.isSuccessful) {
            Toast.makeText(
              applicationContext,
              "Check email and reset the password.",
              Toast.LENGTH_SHORT
            ).show()
          } else {
            Toast.makeText(
              applicationContext,
              task.exception?.message,
              Toast.LENGTH_SHORT
            ).show()
          }
        }

      Kotlin language logo
      Reset Password

      Kotlin recipes

      The code will attempt to send an email to the provided email address, and if the email is successfully sent, the user's password will be reset. If there is an error while trying to send the email, the exception message will be displayed.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.