mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
AuthControllerTests
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Govor.API.Services;
|
||||
using Govor.API.Services.Authentication;
|
||||
using Govor.Core.DTOs;
|
||||
using Govor.API.Services.Authentication.Interfaces;
|
||||
using Govor.Core.Requests;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Govor.API.Controllers;
|
||||
@@ -75,6 +74,11 @@ public class AuthController : Controller
|
||||
_logger.LogWarning(ex, "Login failed for user {Name}", userRequest.Name);
|
||||
return BadRequest("Login failed: user does not exist.");
|
||||
}
|
||||
catch (LoginUserException ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Login failed for user {Name}", userRequest.Name);
|
||||
return BadRequest("Login failed: username or password is incorrect.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Unexpected error during login for user {Name}", userRequest.Name);
|
||||
|
||||
Reference in New Issue
Block a user