checkpoint

This commit is contained in:
2026-10-28 14:22:27 +02:00
parent 33dad8ca5a
commit bd22fa86b7
11 changed files with 161 additions and 52 deletions
+6 -3
View File
@@ -1,12 +1,15 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace StatiKosev.Pages;
[Authorize(Policy = "AdminOnly")]
//open to everyone: shows the admin password form, or the inbox once the admin cookie is set
public class InboxModel : PageModel
{
public void OnGet()
public bool IsAdmin { get; private set; }
public async Task OnGetAsync()
{
IsAdmin = (await HttpContext.AuthenticateAsync(Program.AdminScheme)).Succeeded;
}
}