File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments