16 lines
431 B
C#
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;
|
|
}
|
|
}
|