Remove old Login endpoint and related documentation
Removed the previous Login method from AuthController, including its XML documentation and Swagger/OpenAPI annotations. This prepares the controller for a revised authentication implementation.
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
using DigitalData.Core.Abstraction.Application;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
|
||||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -16,71 +14,6 @@ namespace EnvelopeGenerator.API.Controllers;
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public partial class AuthController(ILogger<AuthController> logger) : ControllerBase
|
public partial class AuthController(ILogger<AuthController> logger) : ControllerBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Authentifiziert einen Benutzer und generiert ein JWT-Token. Wenn 'cookie' wahr ist, wird das Token als HTTP-Only-Cookie zurückgegeben.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="login">Benutzeranmeldedaten (Benutzername und Passwort).</param>
|
|
||||||
/// <param name="cookie">Wenn wahr, wird das JWT-Token auch als HTTP-Only-Cookie gesendet.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// Gibt eine HTTP 200 oder 401.
|
|
||||||
/// </returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// Sample request:
|
|
||||||
///
|
|
||||||
/// POST /api/auth?cookie=true
|
|
||||||
/// {
|
|
||||||
/// "username": "MaxMustermann",
|
|
||||||
/// "password": "Geheim123!"
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// POST /api/auth?cookie=true
|
|
||||||
/// {
|
|
||||||
/// "id": "1",
|
|
||||||
/// "password": "Geheim123!"
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// </remarks>
|
|
||||||
/// <response code="200">Erfolgreiche Anmeldung. Gibt das JWT-Token im Antwortkörper oder als Cookie zurück, wenn 'cookie' wahr ist.</response>
|
|
||||||
/// <response code="401">Unbefugt. Ungültiger Benutzername oder Passwort.</response>
|
|
||||||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK, "text/javascript")]
|
|
||||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
|
||||||
public Task<IActionResult> Login([FromBody] Login login, [FromQuery] bool cookie = false)
|
|
||||||
{
|
|
||||||
// added to configure open API (swagger and scalar)
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Authentifiziert einen Benutzer und generiert ein JWT-Token. Das Token wird als HTTP-only-Cookie zurückgegeben.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="login">Benutzeranmeldedaten (Benutzername und Passwort).</param>
|
|
||||||
/// <returns>
|
|
||||||
/// Gibt eine HTTP 200 oder 401.
|
|
||||||
/// </returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// Sample request:
|
|
||||||
///
|
|
||||||
/// POST /api/auth/form
|
|
||||||
/// {
|
|
||||||
/// "username": "MaxMustermann",
|
|
||||||
/// "password": "Geheim123!"
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// </remarks>
|
|
||||||
/// <response code="200">Erfolgreiche Anmeldung. Gibt das JWT-Token im Antwortkörper oder als Cookie zurück, wenn 'cookie' wahr ist.</response>
|
|
||||||
/// <response code="401">Unbefugt. Ungültiger Benutzername oder Passwort.</response>
|
|
||||||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK, "text/javascript")]
|
|
||||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
|
||||||
[Route("form")]
|
|
||||||
public Task<IActionResult> Login([FromForm] Login login)
|
|
||||||
{
|
|
||||||
// added to configure open API (swagger and scalar)
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Entfernt das Authentifizierungs-Cookie des Benutzers (AuthCookie)
|
/// Entfernt das Authentifizierungs-Cookie des Benutzers (AuthCookie)
|
||||||
|
|||||||
Reference in New Issue
Block a user