36 lines
985 B
C#
36 lines
985 B
C#
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Manager.Framework.Business
|
|
{
|
|
public class ProfileLogic
|
|
{
|
|
private readonly ILogger<ProfileLogic> _logger;
|
|
|
|
public ProfileLogic(ILogger<ProfileLogic> 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 UnauthorizedAccessException("Authentication error");
|
|
}
|
|
if (string.IsNullOrEmpty(password))
|
|
{
|
|
_logger.LogError($"Authenticate error: No password provided");
|
|
throw new UnauthorizedAccessException("Authentication error");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|