Skip to content

Lowercase emails and default form field values #52

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

janka102
Copy link
Member

@janka102 janka102 commented Feb 23, 2017

Changes all emails to save in lowercase. I was looking through the database and saw someone signed up twice for some reason, and they used one email was all lowercase and the other had a capital letter. These are the same emails, so we should just store them as the same.

  • We will still need to go through the database for existing users and update them if need be.

Also, I added defaults for form fields, so for example if someone decides to # by sending a POST request to the server via some other means than the website, ex curl, and forget a field then it shouldn't error. I tried this and I got an error, MongoDB: CastError: Cast to number failed for value "undefined" at path "studentId" when only sending firstName. Seems like there should be a better way to do this (using the || ''), so if anyone knows, I'm all ears.

This would also fix trying to sign undefined up to our GitHub org.

Copy link

@jakeloo jakeloo left a comment

Choose a reason for hiding this comment

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

Changes look good.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants