namespace Distribution.Features.Auth; /// /// Own-user auth is fully delegated to AuthHex — this service only proxies the four functions /// AuthHex exposes (loginUser/registerUser/getUserDetails/LogoutUser). No local password check or /// token issuance happens here; AuthHex owns credentials and signs the JWT this app validates. /// public class AuthService(IAuthHexClient authHex) { public Task LoginAsync(LoginRequest request, CancellationToken ct = default) => authHex.CallAsync("loginUser", new { identifier = request.Identifier, password = request.Password, userTypeId = request.UserTypeId, deviceName = request.DeviceName }, reference: Guid.NewGuid().ToString(), ct: ct); public Task RegisterAsync(RegisterRequest request, CancellationToken ct = default) => authHex.CallAsync("registerUser", request, reference: Guid.NewGuid().ToString(), ct: ct); public Task GetUserDetailsAsync(Guid userId, CancellationToken ct = default) => authHex.CallAsync("getUserDetails", new { userId }, ct: ct); public Task LogoutAsync(string token, CancellationToken ct = default) => authHex.CallAsync("LogoutUser", new { token }, ct: ct); }