Skip to content

Enforce Lower Case Emails on User Schema #1978

@dannyprikaz

Description

@dannyprikaz

Overview

It was previously possible to create multiple users in the db with the same email if the email was input with inconsistent casing (e.g. jeff@example.com vs. Jeff@example.com). .toLowerCase() has been added in multiple places to prevent this from happening, but as a final safety/sanity check, adding lowercase: true to the userSchema in the backend should ensure that a user document is never stored with capital characters.

Action Items

  • Add lowercase: true to userSchema in backend/models/user.model.js
  • Add test to backend/models/user.model.test.js for the lowercasing of emails

Resources/Instructions

Mongoose Docs
This is issue is a part of the epic: #1456

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Final QA (product)

Relationships

None yet

Development

No branches or pull requests

Issue actions