do sessions in memory and also fix glaring security hole
This commit is contained in:
parent
7b6c155a73
commit
f48b421500
31 changed files with 441 additions and 440 deletions
|
@ -0,0 +1,27 @@
|
|||
using Femto.Common.Domain;
|
||||
using Femto.Modules.Auth.Application.Dto;
|
||||
using Femto.Modules.Auth.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Femto.Modules.Auth.Application.Interface.GetUserInfo;
|
||||
|
||||
internal class GetUserInfoCommandHandler(AuthContext context)
|
||||
: ICommandHandler<GetUserInfoCommand, UserInfo?>
|
||||
{
|
||||
public async Task<UserInfo?> Handle(
|
||||
GetUserInfoCommand request,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
|
||||
var user = await context.Users.SingleOrDefaultAsync(
|
||||
u => u.Id == request.ForUser,
|
||||
cancellationToken
|
||||
);
|
||||
|
||||
if (user is null)
|
||||
return null;
|
||||
|
||||
return new UserInfo(user);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue