mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix autocomplete for current password (#9508)
GitOrigin-RevId: 703de6d6228b9d56d7cf6d7f44acd0dc1ea3e81a
This commit is contained in:
parent
c6f198b3a2
commit
b844e6b7cf
1 changed files with 6 additions and 1 deletions
|
@ -120,6 +120,7 @@ function PasswordForm() {
|
|||
label={t('current_password')}
|
||||
value={currentPassword}
|
||||
handleChange={handleCurrentPasswordChange}
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
<PasswordFormGroup
|
||||
id="new-password-1-input"
|
||||
|
@ -127,6 +128,7 @@ function PasswordForm() {
|
|||
value={newPassword1}
|
||||
handleChange={handleNewPassword1Change}
|
||||
minLength={passwordStrengthOptions?.length?.min || 6}
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
<PasswordFormGroup
|
||||
id="new-password-2-input"
|
||||
|
@ -136,6 +138,7 @@ function PasswordForm() {
|
|||
validationMessage={
|
||||
newPassword1 !== newPassword2 ? t('doesnt_match') : ''
|
||||
}
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
{isSuccess && data?.message?.text ? (
|
||||
<FormGroup>
|
||||
|
@ -166,6 +169,7 @@ type PasswordFormGroupProps = {
|
|||
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void
|
||||
minLength?: number
|
||||
validationMessage?: string
|
||||
autoComplete?: string
|
||||
}
|
||||
|
||||
function PasswordFormGroup({
|
||||
|
@ -175,6 +179,7 @@ function PasswordFormGroup({
|
|||
handleChange,
|
||||
minLength,
|
||||
validationMessage: parentValidationMessage,
|
||||
autoComplete,
|
||||
}: PasswordFormGroupProps) {
|
||||
const [validationMessage, setValidationMessage] = useState('')
|
||||
const [hadInteraction, setHadInteraction] = useState(false)
|
||||
|
@ -200,7 +205,7 @@ function PasswordFormGroup({
|
|||
id={id}
|
||||
type="password"
|
||||
placeholder="*********"
|
||||
autoComplete="new-password"
|
||||
autoComplete={autoComplete}
|
||||
value={value}
|
||||
data-ol-dirty={!!validationMessage}
|
||||
onChange={handleChangeAndValidity}
|
||||
|
|
Loading…
Reference in a new issue