App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2022-07-15] [$250] Password Field should not Autofill with the old password on the Set Password page - reported by @parasharrajat

Open mvtglobally opened this issue 4 years ago • 47 comments

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:

  1. Go the login page.
  2. Enter an email. Press Enter.
  3. Click forget on the password page.
  4. Check the mailbox and Copy the link.
  5. 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 image - 2022-05-31T002838 657

Expensify/Expensify Issue URL: Issue reported by: @parasharrajat Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1651158076558069

View all open jobs on GitHub

mvtglobally avatar May 31 '22 04:05 mvtglobally

Triggered auto assignment to @trjExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

melvin-bot[bot] avatar May 31 '22 04:05 melvin-bot[bot]

Triggered auto assignment to @conorpendergrast (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

melvin-bot[bot] avatar May 31 '22 09:05 melvin-bot[bot]

I'm OOO this week, reassigning.

trjExpensify avatar May 31 '22 09:05 trjExpensify

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!

conorpendergrast avatar Jun 01 '22 04:06 conorpendergrast

Triggered auto assignment to @alex-mechler (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

melvin-bot[bot] avatar Jun 01 '22 04:06 melvin-bot[bot]

Looks good to handle externally!

alex-mechler avatar Jun 01 '22 17:06 alex-mechler

Triggered auto assignment to @adelekennedy (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

melvin-bot[bot] avatar Jun 01 '22 17:06 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (Exported)

melvin-bot[bot] avatar Jun 06 '22 18:06 melvin-bot[bot]

Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Jun 06 '22 18:06 melvin-bot[bot]

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"}

allroundexperts avatar Jun 06 '22 19:06 allroundexperts

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

Harshdeepjoshi avatar Jun 06 '22 19:06 Harshdeepjoshi

@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 avatar Jun 06 '22 19:06 rushatgabhane

@rushatgabhane yes it was a typing mistake

Harshdeepjoshi avatar Jun 06 '22 19:06 Harshdeepjoshi

@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 We can do a quick platform check to determine that.

allroundexperts avatar Jun 06 '22 19:06 allroundexperts

@rushatgabhane Updated my proposal to handle this.

allroundexperts avatar Jun 06 '22 19:06 allroundexperts

@rushatgabhane we can pass textContentType to newPassword https://reactnative.dev/docs/textinput#textcontenttype-ios

Harshdeepjoshi avatar Jun 06 '22 19:06 Harshdeepjoshi

@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.

rushatgabhane avatar Jun 06 '22 19:06 rushatgabhane

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

Harshdeepjoshi avatar Jun 06 '22 19:06 Harshdeepjoshi

@rushatgabhane Apologies. Mine updated proposal is same as that of @Harshdeepjoshi.

allroundexperts avatar Jun 06 '22 19:06 allroundexperts