17 lines
474 B
C#
17 lines
474 B
C#
|
|
using Microsoft.AspNetCore.Authentication;
|
||
|
|
using Microsoft.AspNetCore.Authentication.Cookies;
|
||
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||
|
|
|
||
|
|
namespace SoroushAsadi.Pages.Admin;
|
||
|
|
|
||
|
|
[IgnoreAntiforgeryToken]
|
||
|
|
public class LogoutModel : PageModel
|
||
|
|
{
|
||
|
|
public async Task<IActionResult> OnPostAsync()
|
||
|
|
{
|
||
|
|
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||
|
|
return RedirectToPage("/Admin/Login");
|
||
|
|
}
|
||
|
|
}
|