hopefully not a horribly foolish refactoring
This commit is contained in:
parent
59d660165f
commit
1ecaf64dea
82 changed files with 782 additions and 398 deletions
|
@ -0,0 +1,23 @@
|
|||
using Femto.Modules.Authentication.Data;
|
||||
using Femto.Modules.Authentication.Models;
|
||||
|
||||
namespace Femto.Modules.Authentication.Contracts;
|
||||
|
||||
internal class AuthenticationService(AuthenticationContext context) : IAuthenticationService
|
||||
{
|
||||
public async Task<UserInfo> 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<UserInfo> Authenticate(string username, string password)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class AuthenticationError(string message, Exception inner) : Exception(message, inner);
|
Loading…
Add table
Add a link
Reference in a new issue