diff --git a/LittleShop/Areas/Admin/Controllers/AccountController.cs b/LittleShop/Areas/Admin/Controllers/AccountController.cs index 727eb29..d8aeff6 100644 --- a/LittleShop/Areas/Admin/Controllers/AccountController.cs +++ b/LittleShop/Areas/Admin/Controllers/AccountController.cs @@ -29,8 +29,12 @@ public class AccountController : Controller [HttpPost] // [ValidateAntiForgeryToken] // Temporarily disabled for HTTPS proxy issue - public async Task Login(string username, string password) + public async Task Login(string Username, string Password) { + // Make parameters case-insensitive for form compatibility + var username = Username?.ToLowerInvariant(); + var password = Password; + Console.WriteLine($"Received Username: '{username}', Password: '{password}'"); if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) @@ -39,8 +43,8 @@ public class AccountController : Controller return View(); } - // Use AuthService to validate against database users - var loginDto = new LoginDto { Username = username, Password = password }; + // Use AuthService to validate against database users (username already lowercase) + var loginDto = new LoginDto { Username = username!, Password = password }; var authResponse = await _authService.LoginAsync(loginDto); if (authResponse != null)