checkpoint
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user