updated controllers and some services to use async/await

This commit is contained in:
Cameron
2024-08-29 05:36:01 -05:00
parent 18de6d599b
commit 8302e3ea61
36 changed files with 1981 additions and 1809 deletions

View File

@@ -1,33 +1,32 @@
using ComiServ.Entities;
namespace ComiServ.Services
namespace ComiServ.Services;
public interface IAuthenticationService
{
public interface IAuthenticationService
public bool Tested { get; }
public User? User { get; }
public void Authenticate(User user);
public void FailAuth();
}
//acts as a per-request container of authentication info
public class AuthenticationService : IAuthenticationService
{
public bool Tested { get; private set; } = false;
public User? User { get; private set; }
public AuthenticationService()
{
public bool Tested { get; }
public User? User { get; }
public void Authenticate(User user);
public void FailAuth();
}
//acts as a per-request container of authentication info
public class AuthenticationService : IAuthenticationService
public void Authenticate(User user)
{
public bool Tested { get; private set; } = false;
public User? User { get; private set; }
public AuthenticationService()
{
}
public void Authenticate(User user)
{
User = user;
Tested = true;
}
public void FailAuth()
{
User = null;
Tested = true;
}
User = user;
Tested = true;
}
public void FailAuth()
{
User = null;
Tested = true;
}
}