Files
StatiKosev/Pages/Inbox.cshtml.cs
T
2026-10-28 14:22:27 +02:00

16 lines
431 B
C#

using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace StatiKosev.Pages;
//open to everyone: shows the admin password form, or the inbox once the admin cookie is set
public class InboxModel : PageModel
{
public bool IsAdmin { get; private set; }
public async Task OnGetAsync()
{
IsAdmin = (await HttpContext.AuthenticateAsync(Program.AdminScheme)).Succeeded;
}
}