mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-17 01:00:07 +01:00
feat: experimental cors support
This commit is contained in:
@@ -5,11 +5,13 @@ using QuotifyBE.Entities;
|
||||
using QuotifyBE.DTOs;
|
||||
using System.Threading.Tasks;
|
||||
using QuotifyBE.Mapping;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
||||
namespace QuotifyBE.Controllers;
|
||||
|
||||
|
||||
[ApiController]
|
||||
[EnableCors]
|
||||
[Route("api/v1/auth")]
|
||||
[Produces("application/json")]
|
||||
public class AuthController : ControllerBase
|
||||
@@ -42,6 +44,7 @@ public class AuthController : ControllerBase
|
||||
/// <response code="401">Returned on request with unknown pair of email and password (wrong password)</response>
|
||||
/// <response code="404">Returned on request with unknwon email</response>
|
||||
[HttpPost("login")]
|
||||
[EnableCors]
|
||||
[ProducesResponseType(typeof(SuccessfulLoginDTO), 200)]
|
||||
[ProducesResponseType(typeof(ErrorDTO), 400)]
|
||||
[ProducesResponseType(typeof(ErrorDTO), 401)]
|
||||
@@ -87,6 +90,7 @@ public class AuthController : ControllerBase
|
||||
/// <response code="401">Returned on request with invalid JWT</response>
|
||||
[HttpGet("some_values")]
|
||||
[Authorize]
|
||||
[EnableCors]
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(401)]
|
||||
public IActionResult GetValues()
|
||||
|
||||
Reference in New Issue
Block a user