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

Case-insensitive username at login #2010

Merged
merged 2 commits into from
Jan 26, 2022
Merged

Case-insensitive username at login #2010

merged 2 commits into from
Jan 26, 2022

Conversation

Kradyz
Copy link
Contributor

@Kradyz Kradyz commented Dec 21, 2021

When logging in, compares lower(input name) to lower(database name).

I tested several ways to check for lower(local_user::email) as well, but I can't find the correct syntax to transform a type Option<String> to lowercase.

@dessalines
Copy link
Member

dessalines commented Dec 21, 2021

With rust option types, you can do:

option_var.map(|e| ....) and it'll convert whatever's inside the option but still keep it wrapped as an option.

That pry isn't needed for this tho, email is fine to leave case sensitive. Thanks for thinking of this, you're really helping with these PRs!

edit: oh one other thing in the future: try to make sure commits reference or close issues. And if an issue doesn't exist, open one up to have a commit close it.

@Kradyz
Copy link
Contributor Author

Kradyz commented Dec 22, 2021

@dessalines Oh, thank you! Last thing I tried was to use "unwrap_or()" to turn the null value into a string as well, but that did not work out. Maybe the sql_function lower would work if the definition is changed to include what to do in the null case. But since it doesn't matter that the e-mail is case insensitive I won't worry about it for now.

I am very happy if I can be even a bit helpful towards this project! The rest of the year I will go on holidays, but next year I will see if I can help with some issues. Thank you a lot for taking the time to explain things.

try to make sure commits reference or close issues. And if an issue doesn't exist, open one up to have a commit close it.

Alright, sorry! I try to be conservative about posting because I worry about making clutter in your working space, but it makes sense that adding issues would help keep things organized. Next time I will make sure to address or create an issue.

@Nutomic Nutomic merged commit 1c5c02e into LemmyNet:main Jan 26, 2022
@Nutomic
Copy link
Member

Nutomic commented Jan 26, 2022

Sorry, i missed this completely for some reason. Thanks for your contribution!

dessalines pushed a commit that referenced this pull request Jan 27, 2022
* Case-insensitive username at login

* formatting

Co-authored-by: Kradyz <k@radiz.nl>
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.

3 participants