Fix: Resolve Username Case Sensitivity Issue in Login Flow (#1070)

* Fix: Username changing

The only situation where the username must be unique is when changing the username.

* Update UserController.java
This commit is contained in:
Ludy
2024-04-14 23:07:03 +02:00
committed by GitHub
parent 032388a8e3
commit ace4e200b1
6 changed files with 22 additions and 17 deletions

View File

@@ -95,7 +95,7 @@ public class AccountWebController {
// Fetch user details from the database
Optional<User> user =
userRepository.findByUsername(
userRepository.findByUsernameIgnoreCase(
username); // Assuming findByUsername method exists
if (!user.isPresent()) {
// Handle error appropriately
@@ -145,7 +145,7 @@ public class AccountWebController {
// Fetch user details from the database
Optional<User> user =
userRepository.findByUsername(
userRepository.findByUsernameIgnoreCase(
username); // Assuming findByUsername method exists
if (!user.isPresent()) {
// Handle error appropriately