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

Prevent duplicate user email #236

Merged
merged 6 commits into from
Sep 4, 2023
Merged

Conversation

hahn-kev
Copy link
Collaborator

@hahn-kev hahn-kev commented Aug 14, 2023

closes #208

created a collation in the db called case_insensitive any column (or comparison) that uses this collation will be done in a case insensitive manner. Collations can be applied per expression. For example where user = 'test' will use the default column collation or if you wanted to be explicit where user = 'test' COLLATE "case_insensitive" now the comparison is case insensitive. My fix is to make the email column case insensitive by setting it's default collation. If for some reason we wanted to do a case sensitive comparison we could do this: where email = 'something' collate "default" now the case_insensitive collation won't be used for that expression. The equivelent in EF would be this: Where(u => EF.Functions.Collate(u.Email, "default") == "test@email")

this also required making some changes to how this error is handled on the client side. Now the form modal callback can return either a string for a generic error message, or an object (matching the superform errors type) with errors per column. I only made this change to the Form modal, but it might also make sense to apply to the form callback also.

@github-actions
Copy link

github-actions bot commented Aug 14, 2023

UI unit Tests

1 tests  ±0   1 ✔️ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit d7ffb4c. ± Comparison against base commit af7c691.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Aug 14, 2023

Unit Tests

8 tests  ±0   8 ✔️ ±0   9s ⏱️ -1s
3 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit e0b60e6. ± Comparison against base commit ee1a8db.

♻️ This comment has been updated with latest results.

@hahn-kev hahn-kev requested a review from myieye August 14, 2023 07:47
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

C# Unit Tests

8 tests  ±0   8 ✔️ ±0   10s ⏱️ -1s
3 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit d7ffb4c. ± Comparison against base commit af7c691.

frontend/src/lib/i18n/locales/en.json Outdated Show resolved Hide resolved
Co-authored-by: Tim Haasdyk <myieye@gmail.com>
@hahn-kev hahn-kev merged commit 2d95db7 into develop Sep 4, 2023
3 checks passed
@hahn-kev hahn-kev deleted the prevent-duplicate-user-email branch July 9, 2024 07:26
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.

prevent users from having the same email address and user
2 participants