Skip to content

Commit

Permalink
Added POST Login Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
philgei committed Jan 28, 2025
1 parent de2494d commit 7a4e8d2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions AdLerBackend.API/Controllers/LMSUserService/LMSUserController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AdLerBackend.Application.Common.Responses.LMSAdapter;
using System.ComponentModel.DataAnnotations;
using AdLerBackend.Application.Common.Responses.LMSAdapter;
using AdLerBackend.Application.LMS.GetLMSToken;
using AdLerBackend.Application.LMS.GetUserData;
using MediatR;
Expand All @@ -9,6 +10,7 @@
namespace AdLerBackend.API.Controllers.LMSUserService;

[Route("api/Users")]
[ApiController]
public class LmsLoginController(IMediator mediator) : BaseApiController(mediator)
{
[HttpGet("UserData")]
Expand All @@ -22,9 +24,17 @@ public async Task<ActionResult<LMSUserDataResponse>> GetLmsUserData(
}

[HttpGet("Login")]
public async Task<ActionResult<LMSUserTokenResponse>> GetLmsUserToken(
[Obsolete("This method is deprecated and will be removed in future versions. Use the POST method instead.")]
public async Task<ActionResult<LMSUserTokenResponse>> GetLmsUserTokenWithGet(
[FromQuery] GetLMSTokenCommand command)
{
return await Mediator.Send(command);
}

[HttpPost("Login")]
public async Task<ActionResult<LMSUserTokenResponse>> GetLmsUserToken(
[FromBody] [Required] GetLMSTokenCommand command)
{
return await Mediator.Send(command);
}
}

0 comments on commit 7a4e8d2

Please sign in to comment.