healthchecks
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using back.DataModels;
|
||||
using back.DTO;
|
||||
using back.services.bussines;
|
||||
using back.services.bussines.UserService;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace back.controllers;
|
||||
@@ -44,14 +46,14 @@ public class UsersController(IUserService user) : ControllerBase
|
||||
if (user == null || string.IsNullOrEmpty(user.Email) || string.IsNullOrEmpty(user.Password))
|
||||
return BadRequest(Errors.BadRequest.Description);
|
||||
|
||||
if (user.Email.Equals("@system", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (user.Email.Equals(DataModels.User.SystemUser.Email, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrEmpty(user.SystemKey))
|
||||
return Unauthorized(Errors.Unauthorized.Description);
|
||||
var systemUser = await _user.ValidateSystemUser(user.Email, user.Password, user.SystemKey, clientId);
|
||||
if (systemUser == null)
|
||||
return Unauthorized(Errors.Unauthorized.Description);
|
||||
return Ok(systemUser);
|
||||
return Ok(systemUser.Adapt<UserDto>());
|
||||
}
|
||||
|
||||
var existingUser = await _user.Login(user.Email, user.Password, clientId);
|
||||
|
Reference in New Issue
Block a user