using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using QuantEngine.Web.Services;

namespace QuantEngine.Web.Pages.Account;

[Authorize(AuthenticationSchemes = AdminAuthDefaults.Scheme)]
public class LogoutModel : PageModel
{
    public async Task<IActionResult> OnGetAsync()
    {
        await HttpContext.SignOutAsync(AdminAuthDefaults.Scheme);
        return RedirectToPage("/Account/Login");
    }
}
