diff --git a/SurveyBackend/SurveyBackend.API/Controllers/AuthController.cs b/SurveyBackend/SurveyBackend.API/Controllers/AuthController.cs new file mode 100644 index 0000000..94f1cb4 --- /dev/null +++ b/SurveyBackend/SurveyBackend.API/Controllers/AuthController.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore.Mvc; +using SurveyBackend.DTOs; + +namespace SurveyBackend.Controllers; + +[ApiController] +[Route("[controller]")] +public class AuthController : ControllerBase +{ + [HttpPost("login")] + public async Task GetToken([FromBody] UserLoginDTO loginData) + { + return Ok(); + } +} \ No newline at end of file diff --git a/SurveyBackend/SurveyBackend.API/DTOs/UserLoginDTO.cs b/SurveyBackend/SurveyBackend.API/DTOs/UserLoginDTO.cs index a6125a7..9dc2510 100644 --- a/SurveyBackend/SurveyBackend.API/DTOs/UserLoginDTO.cs +++ b/SurveyBackend/SurveyBackend.API/DTOs/UserLoginDTO.cs @@ -2,6 +2,6 @@ namespace SurveyBackend.DTOs; public record UserLoginDTO { - public string Email { get; set; } - public string Password { get; set; } + public required string Email { get; set; } + public required string Password { get; set; } } \ No newline at end of file diff --git a/SurveyBackend/SurveyBackend.API/Program.cs b/SurveyBackend/SurveyBackend.API/Program.cs index 3a98e82..e7d098c 100644 --- a/SurveyBackend/SurveyBackend.API/Program.cs +++ b/SurveyBackend/SurveyBackend.API/Program.cs @@ -8,6 +8,8 @@ public class Program // Add services to the container. builder.Services.AddAuthorization(); + + builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); @@ -22,10 +24,10 @@ public class Program app.UseSwaggerUI(); } - app.UseHttpsRedirection(); - app.UseAuthorization(); + app.MapControllers(); + app.Run(); } } \ No newline at end of file