Thanks to visit codestin.com
Credit goes to github.com

Skip to content

coderd: treat email case insensitively #4215

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

Merged
merged 6 commits into from
Sep 27, 2022
Merged

coderd: treat email case insensitively #4215

merged 6 commits into from
Sep 27, 2022

Conversation

ammario
Copy link
Member

@ammario ammario commented Sep 26, 2022

Resolves #4213

@ammario ammario requested a review from coadler September 26, 2022 22:57
@ammario ammario enabled auto-merge (squash) September 26, 2022 22:57
@coadler
Copy link
Contributor

coadler commented Sep 26, 2022

The index should be changed to be case insensitive too like this https://github.com/coder/v1/blob/master/product/coder/pkg/lifecycle/migrations/1647279660_case_insensitive_usernames.go#L56

@ammario
Copy link
Member Author

ammario commented Sep 26, 2022

check again @coadler

@@ -17,7 +17,7 @@ SELECT
FROM
users
WHERE
(LOWER(username) = LOWER(@username) OR email = @email)
(LOWER(username) = LOWER(@username) OR LOWER(email) = (@email))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need a LOWER(@email) here too

@ammario ammario merged commit 47a53ce into main Sep 27, 2022
@ammario ammario deleted the login-case branch September 27, 2022 03:51
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.

Login email should not be case sensitive
2 participants