using MyCore.Framework.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace MyCore.Framework.Business { public class ProfileLogic { private readonly ILogger _logger; public ProfileLogic(ILogger logger) : base() { _logger = logger; } public bool Authenticate(string email, string password) { if (string.IsNullOrWhiteSpace(email)) { _logger.LogError($"Authenticate error: No e-mail provided"); throw new RequestException(StatusCodes.Status401Unauthorized, "Authentication error"); } if (string.IsNullOrEmpty(password)) { _logger.LogError($"Authenticate error: No password provided"); throw new RequestException(StatusCodes.Status401Unauthorized, "Authentication error"); } return true; } } }