use client/server model

This commit is contained in:
2024-07-21 09:53:17 +02:00
parent 005685ee2a
commit e88d1ff009
4 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using OwnChar.Api.Responses;
using OwnChar.Base.Data.Responses;
using OwnChar.Model;
using OwnChar.Server.Data.Model;
namespace OwnChar.ServerNew.Api.Endpoint.Implementations;
@@ -14,7 +15,7 @@ internal class LoginApi(ServerContext server) : IApiEndpoint
private IResult Login(string username, [FromHeader(Name = "X-USER-PASSWORD")] string password)
{
if (server.Data != null && server.Data.Set<UserAccount>()?.FirstOrDefault(n => n.Username == username && n.Password == password) is UserAccount account)
if (server.Data != null && server.Data.Set<UserAccountDb>()?.FirstOrDefault(n => n.Username == username && n.Password == password) is UserAccountBase account)
return TypedResults.Ok(new LoginResponse
{
Secret = server.Login(account),