set basic layout, error boundary, add QR code for 2FA

This commit is contained in:
2023-12-23 19:59:13 +01:00
parent 78ce5dc512
commit 0b15dd50ab
30 changed files with 1674 additions and 34 deletions
@@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations;
using Kemkas.Web.Db.Models;
using Kemkas.Web.Services.Character;
using Kemkas.Web.ViewModels;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Kemkas.Web.Controllers;
@@ -16,7 +17,7 @@ public class CharacterController(
: ControllerBase
{
[HttpPost]
public async Task<ActionResult<Guid>> StoreNewCharacter([FromBody] CharacterDto dto)
public async Task<ActionResult<Guid>> StoreNewCharacter([FromBody] CharacterDto dto, bool isPublic = true)
{
if (!ModelState.IsValid)
{
@@ -52,4 +53,11 @@ public class CharacterController(
return dbModelToDtoService.Convert(entity);
}
[HttpGet]
[Authorize]
public async Task<List<CharacterListItemDto>> GetAllCharacters()
{
return await persistenceService.GetAllCharactersOfUser();
}
}