Implemented user logout and deletion service. Added Auth, Deletion and Logout hook. Restructed controllers
This commit is contained in:
13
Moonlight.Api/Interfaces/IUserAuthHook.cs
Normal file
13
Moonlight.Api/Interfaces/IUserAuthHook.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Security.Claims;
|
||||
using Moonlight.Api.Database.Entities;
|
||||
|
||||
namespace Moonlight.Api.Interfaces;
|
||||
|
||||
public interface IUserAuthHook
|
||||
{
|
||||
public Task<bool> SyncAsync(ClaimsPrincipal principal, User trackedUser);
|
||||
|
||||
// Every implementation of this function should execute as fast as possible
|
||||
// as this directly impacts every api call
|
||||
public Task<bool> ValidateAsync(ClaimsPrincipal principal, int userId);
|
||||
}
|
||||
9
Moonlight.Api/Interfaces/IUserDeletionHook.cs
Normal file
9
Moonlight.Api/Interfaces/IUserDeletionHook.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Moonlight.Api.Database.Entities;
|
||||
|
||||
namespace Moonlight.Api.Interfaces;
|
||||
|
||||
public interface IUserDeletionHook
|
||||
{
|
||||
public Task<bool> ValidateAsync(User user, List<string> errors);
|
||||
public Task ExecuteAsync(User user);
|
||||
}
|
||||
8
Moonlight.Api/Interfaces/IUserLogoutHook.cs
Normal file
8
Moonlight.Api/Interfaces/IUserLogoutHook.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Moonlight.Api.Database.Entities;
|
||||
|
||||
namespace Moonlight.Api.Interfaces;
|
||||
|
||||
public interface IUserLogoutHook
|
||||
{
|
||||
public Task ExecuteAsync(User user);
|
||||
}
|
||||
Reference in New Issue
Block a user