Files
flatrender/services/identity/FlatRender.IdentitySvc/Application/Services/Interfaces/IAuthService.cs
T

25 lines
1.4 KiB
C#
Raw Normal View History

using FlatRender.IdentitySvc.Models.Requests;
using FlatRender.IdentitySvc.Models.Responses;
namespace FlatRender.IdentitySvc.Application.Services.Interfaces;
public interface IAuthService
{
Task<RegisterResponse> RegisterAsync(RegisterRequest request, string? ipAddress);
Task<AuthTokensResponse> LoginAsync(LoginRequest request, string? ipAddress);
Task<AuthTokensResponse> RefreshAsync(string refreshToken);
Task LogoutAsync(Guid sessionId, Guid userId);
Task<List<SessionResponse>> GetSessionsAsync(Guid userId);
Task RevokeSessionAsync(Guid sessionId, Guid userId);
Task<bool> VerifyEmailAsync(string tokenHash, string code);
Task<bool> VerifyPhoneAsync(string tokenHash, string code);
Task RequestPasswordResetAsync(string tenantSlug, string? email, string? phone);
Task<bool> ConfirmPasswordResetAsync(string token, string newPassword);
Task ChangePasswordAsync(Guid userId, string currentPassword, string newPassword);
Task<MfaSetupResponse> SetupMfaAsync(Guid userId, string factorType, string? label);
Task<bool> VerifyMfaAsync(Guid userId, Guid factorId, string code);
Task<AuthTokensResponse> ChallengeMfaAsync(string mfaToken, string code);
Task SubscribePushAsync(Guid userId, Guid tenantId, string endpoint, string p256dh, string auth, string? userAgent);
Task UnsubscribePushAsync(Guid userId, string? endpoint);
}