Skip to content

Conversation

@bernhaaard
Copy link
Contributor

  • uses transforms at dto layer to transform all incoming emails and ensure they are lowercase

FelixTeutsch and others added 3 commits June 20, 2025 00:40
…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>
@bernhaaard bernhaaard self-assigned this Jun 19, 2025
Copilot AI review requested due to automatic review settings June 19, 2025 23:38
@bernhaaard bernhaaard requested a review from jb-cc as a code owner June 19, 2025 23:38
@bernhaaard bernhaaard changed the base branch from main to dev June 19, 2025 23:38
@bernhaaard bernhaaard force-pushed the SCRUM-307-backend-make-email-case-insensitive branch from 9dd1e3f to 6451f31 Compare June 19, 2025 23:39

This comment was marked as outdated.

@bernhaaard bernhaaard requested a review from Mohammed87FS June 20, 2025 08:09
Mohammed87FS
Mohammed87FS previously approved these changes Jun 20, 2025
Copy link
Contributor

@Mohammed87FS Mohammed87FS left a comment

Choose a reason for hiding this comment

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

well done

@bernhaaard bernhaaard force-pushed the SCRUM-307-backend-make-email-case-insensitive branch from 6451f31 to ea0d9d2 Compare June 20, 2025 10:03
@jb-cc jb-cc requested a review from Copilot June 20, 2025 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 jb-cc force-pushed the SCRUM-307-backend-make-email-case-insensitive branch from ea0d9d2 to 519a7eb Compare June 20, 2025 19:27
@jb-cc jb-cc self-requested a review June 20, 2025 19:33
Copy link
Contributor

@jb-cc jb-cc left a comment

Choose a reason for hiding this comment

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

When I use this branch, and add myself as an admin with CC221012@fhstp.ac.at, and then try to sign up with cc221012@fhstp.ac.at in clerk, it still does not work. and signs me up as a student instead. please take a look again.

image
image
image

@jb-cc jb-cc dismissed Mohammed87FS’s stale review June 20, 2025 22:02

The merge-base changed after approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants