Scrum 307 backend make email case insensitive#203
Open
bernhaaard wants to merge 9 commits intodevfrom
Open
Conversation
Contributor
bernhaaard
commented
Jun 19, 2025
- uses transforms at dto layer to transform all incoming emails and ensure they are lowercase
…plementaiton (SCRUM-210) (#197) Co-authored-by: jb-cc <115902941+jb-cc@users.noreply.github.com>
Co-authored-by: jb-cc <115902941+jb-cc@users.noreply.github.com>
9dd1e3f to
6451f31
Compare
6451f31 to
ea0d9d2
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that all incoming email addresses are normalized to lowercase to enforce case-insensitivity.
- Updated test cases to expect lowercase emails.
- Added Transform decorators in DTOs using a dedicated normalizeEmail utility.
- Modified the registration strategy to lowercase the email from payload.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/modules/users/users.service.spec.ts | Updated mock emails in service tests to be all lowercase. |
| backend/src/modules/users/users.repository.spec.ts | Updated mock emails and search queries in repository tests to be all lowercase. |
| backend/src/modules/users/dto/update-user.dto.ts | Added Transform decorator on the email property to normalize the email. |
| backend/src/modules/users/dto/create-user.dto.ts | Added Transform decorator on the email property to normalize the email. |
| backend/src/modules/requests/supervision/dto/create-supervision-request.dto.ts | Added Transform decorator on the email property to normalize the email. |
| backend/src/modules/auth/strategies/clerk-registration.strategy.ts | Applied toLowerCase directly on the payload email during registration. |
| backend/src/modules/admin/dto/supervisors-bulk-import.dto.ts | Added Transform decorator on the email property in the Supervisor DTO. |
| backend/src/modules/admin/dto/create-admin.dto.ts | Added Transform decorator on the email property to normalize the email. |
| backend/src/common/utils/email-utils.ts | Added a new utility function to convert emails to lowercase. |
jb-cc
approved these changes
Jun 20, 2025
ea0d9d2 to
519a7eb
Compare
jb-cc
requested changes
Jun 20, 2025
The merge-base changed after approval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


