'Firebase Authentication : change requirements and message on password reset through email [duplicate]

Currently, when resetting a password, the firebase requirements provide a very vague and poorly worded message "Strong passwords have at least 6 characters and a mix of letters and numbers". I dislike this message because it never definitively tells the user that they must have a strong password. I would prefer if my message could be a command instead of an enforced suggestion.

Also, I have different requirements to log into my firebase, I require 8 characters and at least one of which must be a special character.

If you have any idea on changing the requirements message or requirements, please let me know.

There are similar posts but they are almost 10 years old and do not provide a solution.



Solution 1:[1]

You can check the error code instead and then show your custom error:

if (error.code === "weak-password") {
  console.log("Custom error message")
}

However this will not chnage the restriction on Firebase end and users can create passwords with 6 char directly using API

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharmaraj