28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
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();
|
|
Task<List<UserEntity>> GetAllUsersAsync();
|
|
Task<bool> SetUserActiveAsync(int userId, bool active);
|
|
Task<bool> DeleteUserAsync(int userId);
|
|
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);
|
|
UserEntity? CurrentUser { get; }
|
|
}
|