Skip to content
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

[FTUE] Forgot password #6263

Merged
merged 24 commits into from
Jun 30, 2022
Merged

[FTUE] Forgot password #6263

merged 24 commits into from
Jun 30, 2022

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Jun 8, 2022

Type of change

  • WIP Feature
  • Bugfix
  • Technical
  • Other :

Content

Introduces reset password screens for email entry, confirmation breaker and new password entry.

Motivation and context

To add support for resetting passwords in the FTUE flow #5284 element-hq/element-meta#135

Screenshots / GIFs

Screenshot_20220608_111216 Screenshot_20220608_111224 Screenshot_20220608_111303 Screenshot_20220613_121018 Screenshot_20220613_120148 Screenshot_20220613_120237
SUCCESS GIF
after-reset-password

Tests

  • Enable the combined login feature flag
  • Follow the reset password flow

Tested devices

  • Physical
  • Emulator
  • OS version(s): 28

@ouchadam ouchadam added the Z-FTUE Issue is relevant to the first time use project or experience label Jun 8, 2022
@ouchadam ouchadam force-pushed the feature/adm/sdk-signout-all-devices branch from e2abbc9 to 3c3bd77 Compare June 8, 2022 11:04
@ouchadam ouchadam mentioned this pull request Jun 8, 2022
6 tasks
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

Unit Test Results

124 files  ±0  124 suites  ±0   2m 19s ⏱️ ±0s
224 tests +2  224 ✔️ +2  0 💤 ±0  0 ±0 
742 runs  +8  742 ✔️ +8  0 💤 ±0  0 ±0 

Results for commit 03c7748. ± Comparison against base commit e2abbc9.

@ouchadam ouchadam force-pushed the feature/adm/ftue-forgot-password branch from 03c7748 to 8f854ee Compare June 9, 2022 11:36
@ouchadam ouchadam force-pushed the feature/adm/sdk-signout-all-devices branch from 7a633a4 to e655a54 Compare June 24, 2022 14:10
Base automatically changed from feature/adm/sdk-signout-all-devices to develop June 27, 2022 07:30
@ouchadam ouchadam force-pushed the feature/adm/ftue-forgot-password branch from b849c17 to ef4889a Compare June 27, 2022 14:25
@ouchadam ouchadam marked this pull request as ready for review June 27, 2022 14:39
@ouchadam ouchadam requested review from a team, onurays and bmarty and removed request for a team June 27, 2022 14:40
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, some remarks.

As a user I would expect to have sort of a confirmation that the password of my account has been updated, maybe a dialog, or inline, but clearly visible in the screen to sign in.

private fun setupUi() {
views.resetPasswordBreakerGradientContainer.setBackgroundResource(
when (themeProvider.isLightTheme()) {
true -> R.drawable.bg_waiting_for_email_verification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted c603b78

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect and you've renamed the bg, nice!

private fun setupViews() {
views.emailEntryInput.associateContentStateWith(button = views.emailEntrySubmit)
views.emailEntryInput.setOnImeDoneListener { startPasswordReset() }
views.emailEntrySubmit.debouncedClicks { startPasswordReset() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe move this line after all the things about emailEntryInput to group them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

views.newPasswordInput.editText().textChanges()
.onEach {
views.newPasswordInput.error = null
views.newPasswordSubmit.isEnabled = it.isEmail()
Copy link
Member

@bmarty bmarty Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it.isEmail() looks wrong here. newPasswordInput is the field to enter the new password, no?

Also the notice suggest that the password should have 8 chars min. But some homeserver may require other requirements. This is just to let you know that this part should be made easy to be customized for forks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh this is definitely wrong, great catch! the reason why the button still works correctly is because https://github.com/vector-im/element-android/pull/6263/files#diff-c29312b48a988ddf4691b69ec9126155953a737ea5d6d5eade6a8db7bc322797R52 is doing the empty content check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks, I was wondering why it was working :)

private fun setupViews() {
views.newPasswordInput.associateContentStateWith(button = views.newPasswordSubmit)
views.newPasswordInput.setOnImeDoneListener { resetPassword() }
views.newPasswordSubmit.debouncedClicks { resetPassword() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: same remark about statement ordering, move this to the end of the fun.

views.signedOutAllGroup.isVisible = state.resetState.supportsLogoutAllDevices

if (state.isLoading) {
views.newPasswordInput.editText().hidePassword()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

addLoginStageFragmentToBackstack(FtueAuthResetPasswordSuccessFragment::class.java)
}
OnboardingViewEvents.OnResetPasswordComplete -> {
activity.popBackstack()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we should try to (silently, i.e. not complain in case of error) login the user here. We have their email and password. Maybe check with product. Also we may want the user to actively use their new password, so there is pros and cons to automatically sign them in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sounds like something to check with product, I can't think of any other services off the top of my head that auto login on password reset 🤔 but there might be some!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, me neither, there must be a good reason not to do it. Maybe to give a chance to any password manager to store the password along with the login.

<string name="ftue_auth_new_password_title">Choose a new password</string>
<string name="ftue_auth_new_password_subtitle">Make sure it\'s 8 characters or more.</string>
<string name="ftue_auth_reset_password">Reset password</string>
<string name="ftue_auth_sign_out_all_devices">Sign out all devices</string>
Copy link
Member

@bmarty bmarty Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change to

Suggested change
<string name="ftue_auth_sign_out_all_devices">Sign out all devices</string>
<string name="ftue_auth_sign_out_all_devices">Sign out all your other devices</string>

for clarity

@@ -36,12 +36,20 @@
<string name="ftue_auth_email_title">Enter your email address</string>
<string name="ftue_auth_email_subtitle">This will help verify your account and enables password recovery.</string>
<string name="ftue_auth_email_entry_title">Email Address</string>
<string name="ftue_auth_reset_password_email_subtitle">We will send you a verification link.</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we mention a link, and in the next screen we mention a button:

<string name="ftue_auth_email_verification_subtitle">To confirm your email address, tap the button in the email we just sent to %s</string>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will bring up in the FTUE room (there's a session planned to go over all of the FTUE copy)

@ouchadam ouchadam force-pushed the feature/adm/ftue-forgot-password branch from 956104b to 9d5b399 Compare June 29, 2022 13:14
…ith and extracts the resetting of errors on content change to an extension
@ouchadam ouchadam force-pushed the feature/adm/ftue-forgot-password branch from 9d5b399 to 1361852 Compare June 29, 2022 13:15
@ouchadam
Copy link
Contributor Author

ouchadam commented Jun 30, 2022

As a user I would expect to have sort of a confirmation that the password of my account has been updated, maybe a dialog, or inline, but clearly visible in the screen to sign in.

Matches iOS by adding a confirmation toast
0d08464

reset-confirmation

@ouchadam ouchadam requested a review from bmarty June 30, 2022 09:46
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

29.8% 29.8% Coverage
0.0% 0.0% Duplication

@bmarty
Copy link
Member

bmarty commented Jun 30, 2022

As a user I would expect to have sort of a confirmation that the password of my account has been updated, maybe a dialog, or inline, but clearly visible in the screen to sign in.

Matches iOS by adding a confirmation toast 0d08464

reset-confirmation reset-confirmation

This is better than nothing, but most users will miss it I guess. A dialog would be better, or a inline message in the form. Also the wording is not very user friendly. Something like "Your password has been successfully changed!" is probably a bit better. Not a blocker but clearly something to polish.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!
Nothing blocking, but I hope we will have the opportunity to polish some parts before enabling the whole feature.

@ouchadam
Copy link
Contributor Author

the password reset flow will be included in the community session test cases, will see what the users think 🤞

@ouchadam ouchadam merged commit 72c4af0 into develop Jun 30, 2022
@ouchadam ouchadam deleted the feature/adm/ftue-forgot-password branch June 30, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-FTUE Issue is relevant to the first time use project or experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants