Test updates by AI

This commit is contained in:
2026-03-24 22:11:58 +01:00
parent 0ebdbca549
commit 8f0cb650c7
11 changed files with 708 additions and 44 deletions
@@ -1,4 +1,8 @@
using AutoMapper;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
@@ -8,10 +12,6 @@ using skydiveLogs_api.DataContract;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainBusiness.Interfaces;
using skydiveLogs_api.Settings;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
namespace skydiveLogs_api.Controllers
{
@@ -34,7 +34,10 @@ namespace skydiveLogs_api.Controllers
#region Public Methods
// GET: api/User/AlwayLogin
/// <summary>
/// Always login endpoint for testing authentication status.
/// </summary>
/// <returns>An Ok result indicating successful authentication.</returns>
[HttpGet("AlwaysLogin")]
[EnableCors]
public IActionResult AlwaysLogin()
@@ -42,7 +45,11 @@ namespace skydiveLogs_api.Controllers
return Ok();
}
// POST: api/User/Authenticate
/// <summary>
/// Authenticates a user with login and password.
/// </summary>
/// <param name="value">UserReq containing login and password.</param>
/// <returns>UserResp with token if successful, BadRequest if failed.</returns>
[AllowAnonymous]
[HttpPost("Authenticate")]
[EnableCors]
@@ -67,7 +74,11 @@ namespace skydiveLogs_api.Controllers
return result;
}
// POST: api/User
/// <summary>
/// Creates a new user and returns JWT token.
/// </summary>
/// <param name="userToAdd">UserReq object containing new user data.</param>
/// <returns>UserResp with token if successful, BadRequest on error.</returns>
[AllowAnonymous]
[HttpPost]
[EnableCors]
@@ -135,4 +146,4 @@ namespace skydiveLogs_api.Controllers
#endregion Private Fields
}
}
}