Add protected admin scope with login

This commit is contained in:
Francesco Lorenzo D'Amico
2026-08-18 14:56:41 +02:00
parent dfe5044c69
commit 04877691b9
7 changed files with 178 additions and 9 deletions
@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace RazorPagesMovie.Pages.Admin;
public class IndexModel : PageModel
{
public void OnGet()
{
}
public async Task<IActionResult> OnPostLogoutAsync()
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return RedirectToPage("/Login");
}
}