refactor: change the error
This commit is contained in:
parent
a96073d44d
commit
95627003e5
@ -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(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user