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

add .trim to v-model for username #9514

Merged

Conversation

marcellamaki
Copy link
Member

@marcellamaki marcellamaki commented Jun 14, 2022

Summary

Adds .trim to the v-model for username on login, so that adding a space before or after the username does not cause a validation failure.

References

Fixes #9471

whitespace-login

Screen Shot 2022-06-14 at 8 53 41 AM

Reviewer guidance

  1. Log in with an existing account, adding a space both before and after the username. The log in should work
  2. After entering a username with whitespace and advancing to enter the password, click "change user". This should work and return to a blank form
  3. Add a space or a special character in the middle of the username. This should fail validation

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

@marcellamaki marcellamaki added this to the Planned Patch 4: Coach usability improvements milestone Jun 14, 2022
@marcellamaki marcellamaki added the TODO: needs review Waiting for review label Jun 14, 2022
@marcellamaki marcellamaki requested review from rtibbles and sairina June 14, 2022 13:12
@marcellamaki marcellamaki changed the base branch from develop to release-v0.15.x June 14, 2022 13:50
@marcellamaki marcellamaki requested a review from radinamatic June 14, 2022 14:33
@radinamatic
Copy link
Member

Trimming the before and after white space in the username (and reporting an error if it's in the middle) is working a-Ok! 👍🏽

I'm only wondering if we should do the same for passwords...? 🤔
In the recording below, the same situation occurs when an accidental white space is introduced before or after the password, resulting in the Incorrect password message. Thinking really hard if there are any downsides to implementing the same trimming here, and I'm coming up empty...

trim

@rtibbles
Copy link
Member

Thinking really hard if there are any downsides to implementing the same trimming here, and I'm coming up empty...

The main downside I can see is that if someone does have a space at the beginning or end of their password, they will never be able to login.

I did a quick scan of the code, and I can't find any place that we do actually remove whitespace from passwords, so it's very possible these may exist. It's also possible I missed where we do this - so if we are already making sure of this, then this change would be ok.

@radinamatic
Copy link
Member

radinamatic commented Jun 15, 2022

if someone does have a space at the beginning or end of their password, they will never be able to login.

But no one is able to save (create account using) the password with the whitespace anyways, as there's an error notification in place for that, right?

@rtibbles
Copy link
Member

as there's an error notification in place for that, right?

Is there? That's what I was unsure about - whether we do trim or error in this case.

@radinamatic
Copy link
Member

I was convinced there was the error notification in that case, but after re-checking both 0.15.2 and the asset from this PR, I'm not able to find one (must have been 🤓 dreaming...).

So yes, given the above it is unwise to implement the trim for passwords, let's merge this then!

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

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

LGTM! 💯 :shipit:

@rtibbles
Copy link
Member

OK, I think github actions have got confused because this was originally targeted to the develop branch, so the Python 3.4 and 3.5 tests did not run. They should not be affected, so this is safe to merge.

@rtibbles rtibbles merged commit def3bf0 into learningequality:release-v0.15.x Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trim whitespace during log in authentication/validation
3 participants