[HOLD for payment 2021-12-06] Change Password - Error message not displayed in red for incorrect new password
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:
- Launch the app and login
- Navigate to settings by clicking on the user avatar over LHN
- Click on change password
- Enter correct old password
- Enter password not meeting the requirement for new password
Expected Result:
Error message displayed in red
Actual Result:
No error message displayed and only message displayed in black about password requirement
Workaround:
None needed, visual issue.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.0.92-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Triggered auto assignment to @Jag96 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
I had worked on the confirm password error message on this page. I would propose a very small fix here,
We should retain the prompt and only change the color of the message when the password doesn't match the requirement. So basically remove this.state.isPasswordRequirementsVisible and change the block to the following:
{(
<Text style={[styles.textLabelSupporting, styles.mt1, !this.isValidPassword() && styles.formError]}>
{this.props.translate('passwordPage.newPasswordPrompt')}
</Text>
)}
Here is my suggestion. We need to start validating (i.e. 1 capital letter, 1 lowercase letter, 1 number) new password as soon as some character entered. So as soon as start entering character in new password field, it will show message in red color due to password not match with rule initially. Now user go on typing new password and as soon as it become valid, the message shows in normal color.
So based on my thinking I will suggest to add condition at line 150 (within PasswordPage.js file), So overall behaviour remain same and it will just show message in red color whenever new password input value is not valid.
Code Before Update: https://github.com/Expensify/App/blob/c2f83f3249e9b07cad15ca403bf19ef37e7b7aee/src/pages/settings/PasswordPage.js#L149-L153
Code After Update ( condition added at line 150):
{this.state.isPasswordRequirementsVisible && (
<Text style={[styles.textLabelSupporting, styles.mt1, (this.state.newPassword && !this.isValidPassword()) && styles.formError]}>
{this.props.translate('passwordPage.newPasswordPrompt')}
</Text>
)}
Below is the screen recording how its looks once the suggested solution implemented.
https://user-images.githubusercontent.com/7823358/132018151-743d282c-9139-40aa-893b-64e11301656f.mov
I understand that External label not set with this issue. So at present consider this as my suggestion. I hope it will be helpful to someone who handle it internally. If this issue considered as external and my solution accepted then kindly invite me on Upwork once project posted. Here is my upwork profile: https://www.upwork.com/freelancers/~01c718889ed7821f82 Thanks.
@isagoico was there a slack thread for this one? I didn't see one but just double-checking so I can have all the context
@Jag96 This was raised as part of our internal QA that's why there's no slack thread linked in this one.
Issue reproducible during KI retests
@Jag96 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
I think for this one we should keep the same convention from https://github.com/Expensify/App/pull/5093, where:
- Initially, the
passwordPage.newPasswordPromptmessage shows with grey text, even when the user hasn't typed anything - When the user starts typing, the
passwordPage.newPasswordPromptmessage shows w/ formError styles - Once the requirements are met, the
passwordPage.newPasswordPromptmessage shows w/ grey text again, even when the user goes to the next field
So the message will always be shown if that makes sense. @mananjadhav @PrashantMangukiya can you post updated proposals to match that convention?
Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
@Jag96 If you see my proposal https://github.com/Expensify/App/issues/4995#issuecomment-911916821 it does exactly the same.
I proposed two changes in the code:
- Remove
this.state.isPasswordRequirementsVisiblecheck so that the hint is always visible - Add
!this.isValidPassword() && styles.formErrorin styles so that formError style is shown when the password is invalid.
I hope it clarifies what you expected.
@mananjadhav it looks like your proposal results in the initial state of the message being shown w/ formError, rather than it starting off grey and only showing w/ formError once the user starts typing:

You're right @Jag96.
Updated Proposal Extending the proposal in the comment (https://github.com/Expensify/App/issues/4995#issuecomment-911916821), I'll update the check for the form style with the following:
<Text style={[styles.textLabelSupporting, styles.mt1, this.state.newPassword && !this.isValidPassword() && styles.formError]}>
{this.props.translate('passwordPage.newPasswordPrompt')}
</Text>
We would still remove the isPasswordRequirementsVisible as it won't be used.
and we can move this.state.newPassword && !this.isValidPassword() check into a function say isInvalidPassword or showFormError.
Does that make sense?
@mananjadhav that sounds good to me, I like the improvement of moving the state check into a new isInvalidPassword function! @puneetlath can you please hire @mananjadhav for this job once you create the Upwork post? @mananjadhav feel free to get started on a PR once you've been hired in Upwork.
Hi @Jag96 and @puneetlath I already suggested this condition from beginning that shows code as under, As you can see within https://github.com/Expensify/App/issues/4995#issuecomment-912573194
{this.state.isPasswordRequirementsVisible && (
<Text style={[styles.textLabelSupporting, styles.mt1, (this.state.newPassword && !this.isValidPassword()) && styles.formError]}>
{this.props.translate('passwordPage.newPasswordPrompt')}
</Text>
)}
Should I submit updated proposal from my side based on the suggested steps mentioned in https://github.com/Expensify/App/issues/4995#issuecomment-914647313 ? If already decided to go within other proposal then it is ok.
Please let me know should I put the updated proposal from my side now?
@PrashantMangukiya your initial proposal did have that included, but it was also hiding the message after the user went to the confirm field. Both initial proposals didn't match the behavior posted in this comment (because the ideal behavior wasn't listed initially), so in this case, I gave the job to @mananjadhav since he posted his initial proposal first and his updated proposal met the requirements.
Hi @Jag96 Thanks for the updates. Its ok no problem. I will not submit updated proposal now. @mananjadhav congrats..
@puneetlath can you please hire @mananjadhav for this job once you create the Upwork post?
Done!
Issue reproducible during KI retests.
Hi @mananjadhav, I've placed this issue on hold as per this update, as we are prioritising issues related to a feature release scheduled for 9/24. As an apology for the delay, we will add a $100 bonus as a thank you for waiting.
Issue reproducible during KI retests.