mirror of
https://github.com/Ikatono/ComiServ.git
synced 2025-10-28 20:45:35 -05:00
Rearranged repo to make room for additional projects
This commit is contained in:
32
ComiServ/Services/AuthenticationService.cs
Normal file
32
ComiServ/Services/AuthenticationService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using ComiServ.Entities;
|
||||
|
||||
namespace ComiServ.Services;
|
||||
|
||||
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 void Authenticate(User user)
|
||||
{
|
||||
User = user;
|
||||
Tested = true;
|
||||
}
|
||||
public void FailAuth()
|
||||
{
|
||||
User = null;
|
||||
Tested = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user