Skip to content

Commit ac9b730

Browse files
author
Jeff_Lin
committed
Modify main
1 parent b13e6ee commit ac9b730

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Backend.Api/Controllers/AuthController.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ namespace Backend.Api.Controllers
1212
[Route("api/main/cuth")]
1313
[ApiController]
1414
[ApiExplorerSettings(GroupName = "v1")]
15-
public class AuthController(IAuthAppService service) : ControllerBase
15+
public class AuthController : ControllerBase
1616
{
17+
private readonly IAuthAppService _service;
18+
19+
public AuthController(IAuthAppService service)
20+
{
21+
_service = service;
22+
}
23+
1724
[HttpPost("login"), AllowAnonymous]
1825
[Produces("application/json")]
1926
[SwaggerResponse(200, "¦¨¥\", typeof(AuthResponse))]
2027
public async Task<IActionResult> Login([FromBody] AuthRequest req)
2128
{
22-
var token = await service.LoginAsync(req.Email, req.Password);
23-
if (token == null) return Unauthorized(new { message = "Invalid credentials" });
29+
var token = await _service.LoginAsync(req.Email, req.Password);
30+
if (token == null) return Unauthorized(new { message = "Invalid credentials" });
2431
return Ok(new { token });
2532
}
2633
}

0 commit comments

Comments
 (0)