2026-10-28 14:22:27 +02:00
|
|
|
using Microsoft.AspNetCore.Authentication;
|
2026-10-28 13:23:35 +02:00
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
|
|
|
|
|
|
namespace StatiKosev.Pages;
|
|
|
|
|
|
2026-10-28 14:22:27 +02:00
|
|
|
//open to everyone: shows the admin password form, or the inbox once the admin cookie is set
|
2026-10-28 13:23:35 +02:00
|
|
|
public class InboxModel : PageModel
|
|
|
|
|
{
|
2026-10-28 14:22:27 +02:00
|
|
|
public bool IsAdmin { get; private set; }
|
|
|
|
|
|
|
|
|
|
public async Task OnGetAsync()
|
2026-10-28 13:23:35 +02:00
|
|
|
{
|
2026-10-28 14:22:27 +02:00
|
|
|
IsAdmin = (await HttpContext.AuthenticateAsync(Program.AdminScheme)).Succeeded;
|
2026-10-28 13:23:35 +02:00
|
|
|
}
|
|
|
|
|
}
|