[HOLD for payment 2022-07-15] [$250] Password Field should not Autofill with the old password on the Set Password page - reported by @parasharrajat
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Go the login page.
- Enter an email. Press Enter.
- Click forget on the password page.
- Check the mailbox and Copy the link.
- open the link on the browser
Expected Result:
Check that if you had saved the password earlier for the email, password field is autofilled.
Actual Result:
It should not autofill with old password as user is expected to enter new password.
Workaround:
unknown
Platform:
Where is this issue occurring?
- Web
Version Number: 1.1.69-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL: Issue reported by: @parasharrajat Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1651158076558069
Triggered auto assignment to @trjExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Triggered auto assignment to @conorpendergrast (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
I'm OOO this week, reassigning.
It looks like there's this autocomplete="new-password" we could add to the password field when they're setting a new password. Seems like that would be helpful!
Triggered auto assignment to @alex-mechler (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Looks good to handle externally!
Triggered auto assignment to @adelekennedy (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (Exported)
Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Proposal
As suggested by @conorpendergrast, we need to set autoComplete to new-password for the specific text input.
The following changes:
https://github.com/allroundexperts/Expensify/blob/0f38b9a0107977e2b49edef1534caf1199e08b38/src/pages/settings/NewPasswordForm.js#L1
To:
import { Platform } from 'react-native';
https://github.com/allroundexperts/Expensify/blob/0f38b9a0107977e2b49edef1534caf1199e08b38/src/pages/settings/NewPasswordForm.js#L71
To:
<TextInput
autoComplete={Platform.OS === "android" ? "password-new": "new-password"}
Proposal
Problem
We're passing autoCompleteType="password" to decide the behaviour of auto complete in the input field which is wrong
Solution
We should pass a prop autoComplete="new-password" for web and autoComplete="password-new"for native
new-password does not work for native
we will pass the new value here https://github.com/Expensify/App/blob/dc300ee45cde0124f6223f715a526c0f50ef2dcc/src/pages/settings/NewPasswordForm.js#L74
@allroundexperts @Harshdeepjoshi I'm really confused here.
autoComplete="new-password" works on web only.
autoComplete="password-new" works for Android only. (React native docs)
So.. what should we do here to fix this issue for web, iOS and Android?
(@Harshdeepjoshi im sure you mean autoComplete and not autoCompleteType)
@rushatgabhane yes it was a typing mistake
@allroundexperts @Harshdeepjoshi I'm really confused here.
autoComplete="new-password"works on web only.autoComplete="password-new"works for Android only. (React native docs)So.. what should we do here to fix this issue for web, iOS and Android?
(@Harshdeepjoshi im sure you mean
autoCompleteand notautoCompleteType)
@rushatgabhane We can do a quick platform check to determine that.
@rushatgabhane Updated my proposal to handle this.
@rushatgabhane we can pass textContentType to newPassword
https://reactnative.dev/docs/textinput#textcontenttype-ios
@allroundexperts your proposal doesn't fix the issue for iOS. Btw, it's highly recommended to post updated proposals as a new comment.
@Harshdeepjoshi yeah, that could work. Please post an updated proposal which is complete, thank you! Sidenote: we prefer platform specific extensions over in-line platform code.
Updated Proposal
Problem
We're passing autoCompleteType="password" to decide the behaviour of auto complete in the input field which is wrong
Solution
We should pass a prop autoComplete="new-password" for web and autoComplete="password-new"for android.
new-password does not work for native.
we can pass textContentType to newPassword for ios https://reactnative.dev/docs/textinput#textcontenttype-ios .
we can modify componentUtils lib and add NEW_PASSWORD_AUTOCOMPLETE_TYPE to platform files index.js and index.native.js . we will use different values as mentioned above for these files.
we will pass NEW_PASSWORD_AUTOCOMPLETE_TYPE and textContentType='newPassword' here https://github.com/Expensify/App/blob/dc300ee45cde0124f6223f715a526c0f50ef2dcc/src/pages/settings/NewPasswordForm.js#L74
@rushatgabhane Apologies. Mine updated proposal is same as that of @Harshdeepjoshi.