using DXPBLL.Auth; using DXPDAL.Common; using DXPSL.Common; using FastEndpoints; using GB5Shared.DTO.Framework.Enum; using GB5Shared.DTO.Framework.ResponseStandard; namespace DXPSL.Endpoints.Auth; // Protected — callable with either the intermediate token (post-Login, pre-context-selection) // or a fully-scoped access token. No request body: DxpUserId comes only from the verified token. public class GetMyContexts : DXPBaseEndpoint> { private readonly IAuthBLL _bll; private readonly IDXPSystemContext _systemContext; public GetMyContexts(IAuthBLL bll, IDXPSystemContext systemContext) { _bll = bll; _systemContext = systemContext; } public override void Configure() => Post("/DXP/Auth/GetMyContexts"); protected override async Task> ExecuteAsync( EmptyRequest req, DXPCallerContext caller, CancellationToken ct) { var contexts = await _bll.GetContextsAsync(caller.DxpUserId, _systemContext.GetSystemLogin(caller.DxpUserId), ct); return new ResponseStandardDTO { Status = FrameworkEnumDTO.ResponseStatus.Ok, Body = contexts }; } }