using PlotLine.Models; using PlotLine.ViewModels; namespace PlotLine.Services; public interface IAuthService { Task RegisterAsync(RegisterViewModel model); Task LoginAsync(LoginViewModel model); bool HasPendingTwoFactorLogin(); string? GetPendingTwoFactorReturnUrl(); Task CompleteTwoFactorLoginAsync(TwoFactorCodeViewModel model); Task CompleteTwoFactorRecoveryLoginAsync(TwoFactorRecoveryViewModel model); Task LogoutAsync(); Task VerifyEmailAsync(Guid token); Task ResendVerificationEmailAsync(string email); Task ForgotPasswordAsync(ForgotPasswordViewModel model); Task ResetPasswordAsync(ResetPasswordViewModel model); Task ChangePasswordAsync(ChangePasswordViewModel model); Task EnableTwoFactorAsync(int userId, string secretKey, string code); Task DisableTwoFactorAsync(int userId, string currentPassword); Task> GenerateRecoveryCodesAsync(int userId); } public interface IAccountDeletionService { Task HardDeleteAccountAsync(int userId); } public interface IPasswordService { string HashPassword(string password); bool VerifyPassword(string password, string passwordHash); } public interface ITwoFactorService { string GenerateSecretKey(); string GenerateQrCodeUri(string email, string secretKey); bool ValidateCode(string secretKey, string code); bool ValidateCode(string secretKey, string code, long? lastUsedTimeStep, out long matchedTimeStep); string? GenerateQrCodeDataUri(string qrCodeUri); IReadOnlyList GenerateRecoveryCodes(int count); } public interface IEmailService { Task SendVerificationEmailAsync(string email, string displayName, Guid token); Task SendPasswordResetEmailAsync(string email, string displayName, Guid token); Task SendFeatureRequestAdminReplyAsync(FeatureRequest request, string messagePreview, string link, string actorEmail); Task SendFeatureRequestStatusChangedAsync(FeatureRequest request, string link, string actorEmail); Task SendFeatureRequestUserReplyAsync(FeatureRequest request, string messagePreview, string link, string actorEmail); } public interface ICurrentUserService { int? UserId { get; } string? Email { get; } string? DisplayName { get; } bool IsAuthenticated { get; } }