Skip to content

Commit 7012fd3

Browse files
committed
Also lowercase the username when checking if it exists.
1 parent b5ed17d commit 7012fd3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/src/user/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl UserRepository for PgUserRepository<'_> {
250250
let exists = sqlx::query_scalar!(
251251
r#"
252252
SELECT EXISTS(
253-
SELECT 1 FROM users WHERE username = $1
253+
SELECT 1 FROM users WHERE LOWER(username) = LOWER($1)
254254
) AS "exists!"
255255
"#,
256256
username

0 commit comments

Comments
 (0)