auth clean up
This commit is contained in:
@@ -2,14 +2,27 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Distribution.Features.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Proxies all authentication traffic from the Next.js frontend to the
|
||||
/// external Auth Service. The frontend must never call the Auth Service
|
||||
/// directly — all auth goes through this controller.
|
||||
///
|
||||
/// TODO: Implement endpoints once Auth Service contract is agreed.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/auth")]
|
||||
public class AuthController(AuthService service) : ControllerBase
|
||||
public class AuthController(IAuthServiceClient authServiceClient) : ControllerBase
|
||||
{
|
||||
// TODO: replace stub endpoints below with real proxy calls once
|
||||
// the Auth Service API contract is finalised.
|
||||
|
||||
[HttpPost("login")]
|
||||
public async Task<IActionResult> Login(LoginRequest request)
|
||||
public Task<IActionResult> Login()
|
||||
{
|
||||
var result = await service.LoginAsync(request);
|
||||
return result is null ? Unauthorized() : Ok(result);
|
||||
// TODO: accept login request shape from Auth Service contract,
|
||||
// forward to authServiceClient, relay response (token / session) back.
|
||||
return Task.FromResult<IActionResult>(StatusCode(501, new { error = "Auth integration not yet implemented." }));
|
||||
}
|
||||
|
||||
// TODO: add further endpoints as needed (refresh, logout, etc.)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user