AuthorBuddy/Services/IAuthService.cs

29 lines
1.1 KiB
C#
Raw Permalink Normal View History

2026-05-21 11:04:42 +02:00
using AuthorBuddy.Web.Data;
namespace AuthorBuddy.Web.Services;
public interface IAuthService
{
Task<bool> LoginAsync(string username, string password);
Task LogoutAsync();
Task<bool> RegisterAsync(string username, string password);
Task AdminBypassLoginAsync(int userId);
Task<UserEntity?> GetCurrentUserAsync();
bool IsLoggedIn { get; }
bool Is2FARequired { get; }
Task<bool> Verify2FAAsync(string code);
Task<string> Generate2FASecretAsync();
string Get2FAProvisioningUri(string secret, string username);
Task<bool> Enable2FAAsync(string secret);
Task<bool> Disable2FAAsync();
Task<bool> Is2FAEnabledAsync();
Task<string?> GetCurrent2FASecretAsync();
2026-05-25 06:38:16 +02:00
Task<List<UserEntity>> GetAllUsersAsync();
Task<bool> SetUserActiveAsync(int userId, bool active);
Task<bool> DeleteUserAsync(int userId);
2026-06-21 07:52:03 +02:00
Task<bool> CreateUserAsync(string username, string password, string email, List<UserRole> roles);
Task<bool> UpdateUserAsync(int userId, string? email, List<UserRole>? roles);
Task<string> ResetPasswordAsync(int userId);
2026-05-25 06:38:16 +02:00
UserEntity? CurrentUser { get; }
2026-05-21 11:04:42 +02:00
}