auth clean up

This commit is contained in:
Kalana B. Thilakarathna
2026-08-25 16:11:37 +05:30
parent 916a2b8f0a
commit bb33928661
9 changed files with 2724 additions and 51 deletions
+17 -4
View File
@@ -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.)
}