using Femto.Modules.Authentication.Data; using Femto.Modules.Authentication.Models; namespace Femto.Modules.Authentication.Contracts; internal class AuthenticationService(AuthenticationContext context) : IAuthenticationService { public async Task Register(string username, string password) { var user = new UserIdentity(username).WithPassword(password); await context.AddAsync(user); await context.SaveChangesAsync(); return new(user.Id, user.Username); } public async Task Authenticate(string username, string password) { throw new NotImplementedException(); } } public class AuthenticationError(string message, Exception inner) : Exception(message, inner);