-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc] Explain how <PasswordInput>
can be used to update a password
#9354
Conversation
@@ -47,3 +57,22 @@ Set the [`autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/ | |||
<PasswordInput source="password" inputProps={{ autocomplete: 'current-password' }} /> | |||
``` | |||
{% endraw %} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to explain how to have 2 password inputs, and how to validate that they are equal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explained.
docs/PasswordInput.md
Outdated
|
||
## Validating Identical Passwords | ||
|
||
If you want to validate that the user has entered the same password in two different password inputs, you must use [global validation](./Validation.md#global-validation) at the form level: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, validators have access to the other form values, so you could write an equalToFieldValidator
:
const equalToFieldValidator = (source: string) => (value: any, allValues: FormValues) => ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL!
Co-authored-by: adrien guernier <adrien@marmelab.com>
Problem
The doc doesn't explain how to use
<PasswordInput>
in Edit view. This may lead developers to expose passwords in clear.Solution
Be very clear about never exposing password, even in the Edition view.