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

Lowercase emails and default form field values #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = (app, logger) => {
// Github actions
logger.info('Request body', req.body)
let response = JSON.parse(ajaxResponse) // Get a copy
let githubUsername = req.body.githubUsername
let githubUsername = req.body.githubUsername || ''

if (githubUsername === '') {
next()
Expand Down Expand Up @@ -70,12 +70,12 @@ module.exports = (app, logger) => {
let body = req.body

let userObj = {
firstName: body.firstName,
lastName: body.lastName,
studentId: body.studentId,
email: body.email,
firstName: body.firstName || '',
lastName: body.lastName || '',
studentId: body.studentId || '',
email: (body.email || '').toLowerCase(),
mailchimp: !!body.mailchimp, // Convert to boolean if not already
github: body.githubUsername
github: body.githubUsername || ''
}

// Search for the user email.
Expand Down