kinda works, but wasteful and misinforming :(

This commit is contained in:
2023-12-23 21:37:11 +01:00
parent 0b15dd50ab
commit 7264b269c0
8 changed files with 93 additions and 26 deletions
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc;
namespace Kemkas.Web.Controllers;
[ApiController]
[Route("[controller]")]
[Route("api/[controller]")]
public class CharacterController(
ICharacterValidationService validationService,
ICharacterDtoToDbModelService dtoToDbModelService,
+18
View File
@@ -0,0 +1,18 @@
using Kemkas.Web.Db.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
namespace Kemkas.Web.Controllers;
[Route("api/[controller]")]
[ApiController]
public class UserController : ControllerBase
{
// GET
[HttpGet("me")]
public async Task<string?> Me([FromServices] UserManager<ApplicationUser> userManager)
{
var user = await userManager.GetUserAsync(User);
return user?.UserName ?? user?.Email;
}
}