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

Better handling of validation errors when remote facility does not require passwords #11704

Merged

Conversation

jredrejo
Copy link
Member

@jredrejo jredrejo commented Jan 5, 2024

Summary

When importing users in a LOD device, authentication errors were not passed as ValidationErrors to the frontend. Also, when the remote facility allowed authentication without password, if the username didn't exist no known error was being passed to the frontend.
This PR fixes these problems.

References

Closes: #11605

Reviewer guidance

Steps to test this PR are described in the steps to reproduce #11605

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@jredrejo jredrejo added the TODO: needs review Waiting for review label Jan 5, 2024
@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: frontend SIZE: small labels Jan 5, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

These changes make sense to me codewise, and do as described in the PR description. Needs manual QA to verify.

@rtibbles rtibbles mentioned this pull request Jan 8, 2024
9 tasks
@radinamatic radinamatic requested a review from pcenov January 9, 2024 01:32
@pcenov
Copy link
Member

pcenov commented Jan 9, 2024

Hi @jredrejo, I confirm that now the message "Incorrect username or password" is being displayed for not existing learner accounts or mistyped username/password.

Here's a list with other issues that I am aware of in terms of validation. Perhaps some of those are in scope for this PR, the rest can be fixed separately:

  • there's still no error message displayed if the user attempts to submit an empty form (that's valid both for the learner credentials form and for the admin credentials form)
  • when we have only the 'Username' field being displayed and I enter an admin username then I am still seeing the "Incorrect username or password" - I think in that case we should be showing the Device limitations modal
  • if after seeing the "Incorrect username or password" message I click the Use an admin account link then the "Incorrect username or password" message is still displayed above the empty form for the admin credentials
  • no distinction for capitals vs small letters in the username - I think this should be fixed as part of fix: validation #11672
  • when we have both the Username and Password fields displayed and I enter the username of a learner who was originally created without a password then it's not accepted as valid credentials and I have to import that learner signed in as an admin. This is probably OK, but just mentioning it here as an edge case in case that could be considered.

@jredrejo
Copy link
Member Author

jredrejo commented Jan 9, 2024

Hi @jredrejo, I confirm that now the message "Incorrect username or password" is being displayed for not existing learner accounts or mistyped username/password.

Here's a list with other issues that I am aware of in terms of validation. Perhaps some of those are in scope for this PR, the rest can be fixed separately:

  • there's still no error message displayed if the user attempts to submit an empty form (that's valid both for the learner credentials form and for the admin credentials form)
  • when we have only the 'Username' field being displayed and I enter an admin username then I am still seeing the "Incorrect username or password" - I think in that case we should be showing the Device limitations modal
  • if after seeing the "Incorrect username or password" message I click the Use an admin account link then the "Incorrect username or password" message is still displayed above the empty form for the admin credentials
  • no distinction for capitals vs small letters in the username - I think this should be fixed as part of fix: validation #11672
  • when we have both the Username and Password fields displayed and I enter the username of a learner who was originally created without a password then it's not accepted as valid credentials and I have to import that learner signed in as an admin. This is probably OK, but just mentioning it here as an edge case in case that could be considered.

hi @pcenov are there open issues for these items? I was not aware of any of these excepting #11540 and want to avoid conflicts with other people work. In case there are not other open issues, please edit #11605 to add this list or create a new one so we can focus and schedule the work because your list is quite overwhelming and means there are quite a lot of problems that can look similar to #11605 but are technically different as most of them are in the frontend not (or not only) in the backend validation.

Copy link
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

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

Ok, thanks @jredrejo - I have created a follow-up issue as suggested.

@rtibbles rtibbles merged commit 6ad58b3 into learningequality:release-v0.16.x Jan 10, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend SIZE: small TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup Wizard - importing user from facility that doesn't require learner passwords
3 participants