Add project files.
This commit is contained in:
15
ConfigurationPannel/Pages/Logout.cshtml.cs
Normal file
15
ConfigurationPannel/Pages/Logout.cshtml.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace ConfigurationPannel.Pages;
|
||||
|
||||
public class LogoutModel : PageModel
|
||||
{
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
return RedirectToPage("/Login");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user