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

Fixing wrong error message when signing in with wrong credentials #6372

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

ouchadam
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Fixes #6371 Wrong error message when signing in with wrong credentials

  • Takes into account if we're in the sign up / in mode when inferring the registration disabled errors. Disabled registration uses the same error code as invalid credentials.

Motivation and context

To avoid confusing the user!

Screenshots / GIFs

Before After
Screenshot_20220623_181959 Screenshot_20220623_181805

Tests

  • Attempt to log in with invalid credentials
  • Notice an error message about registration being disabled

Tested devices

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

@ouchadam ouchadam added the PR-Small PR with less than 20 updated lines label Jun 23, 2022
@@ -286,7 +286,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment<
throwable.isWeakPassword() || throwable.isInvalidPassword() -> {
views.passwordFieldTil.error = errorFormatter.toHumanReadable(throwable)
}
throwable.isRegistrationDisabled() -> {
isSignupMode && throwable.isRegistrationDisabled() -> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

registration disabled is only a valid error for the sign up flow

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ouchadam ouchadam requested review from onurays and mnaturel June 24, 2022 08:20
Copy link
Contributor

@onurays onurays left a comment

Choose a reason for hiding this comment

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

Oh, nice catch! LGTM.

@ouchadam ouchadam merged commit c7881fc into develop Jun 24, 2022
@ouchadam ouchadam deleted the bugfix/adm/wrong-error-on-sign-in branch June 24, 2022 12:15
@bmarty
Copy link
Member

bmarty commented Jun 27, 2022

Sorry to comment on a closed PR, but I think we do not need a dialog in case of wrong password. the error is already displayed inlined in the form. For disabled registration, there is (was?) no form IIRC, so we need to keep it.
Also, I think this issue is sort of a regression, since the error should be handled in the Fragment (to update the form) and so not handled by the default error handler which is displaying a dialog. The issue is fixed so this is fine, I'm just sharing my thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Small PR with less than 20 updated lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong error message when signing in with wrong credentials
4 participants