1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-09-20 01:39:00 +00:00
just-short-it/Pages/Logout.cshtml.cs

13 lines
425 B
C#

using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace JustShortIt.Pages;
public class LogoutModel : PageModel {
public async Task<IActionResult> OnGetAsync() {
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return LocalRedirect("~/");
}
}