-
Notifications
You must be signed in to change notification settings - Fork 767
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
[FTUE] Forgot password #6263
Conversation
e2abbc9
to
3c3bd77
Compare
03c7748
to
8f854ee
Compare
7a633a4
to
e655a54
Compare
… emitting view events to move the flow forwards
b849c17
to
ef4889a
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be extracted and mutualize with https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthWaitForEmailFragment.kt#L62 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted c603b78
There was a problem hiding this comment.
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() } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() } |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change to
<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> |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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)
…is check is wrong but also not needed due to associateContentStateWith above
956104b
to
9d5b399
Compare
…ith and extracts the resetting of errors on content change to an extension
9d5b399
to
1361852
Compare
Matches iOS by adding a confirmation toast |
SonarCloud Quality Gate failed. |
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. |
There was a problem hiding this 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.
the password reset flow will be included in the community session test cases, will see what the users think 🤞 |
Type of change
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
Tests
Tested devices