refactor: change the error

This commit is contained in:
Polianin Nikita 2024-11-04 03:14:17 +03:00
parent a96073d44d
commit 95627003e5

View File

@ -43,7 +43,7 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
if (!userEntity.Username.Equals(request.Username, StringComparison.OrdinalIgnoreCase) && if (!userEntity.Username.Equals(request.Username, StringComparison.OrdinalIgnoreCase) &&
!userEntity.Email.Equals(request.Username, StringComparison.OrdinalIgnoreCase)) !userEntity.Email.Equals(request.Username, StringComparison.OrdinalIgnoreCase))
return BadRequest("Invalid username/email or password"); return Unauthorized("Authentication failed. Please check your credentials.");
var tokenResult = await auth.LoginAsync( var tokenResult = await auth.LoginAsync(
GetCookieParams(), GetCookieParams(),