1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-09-20 09:48:59 +00:00
just-short-it/Pages/Logout.cshtml.cs
2023-04-15 15:40:46 +02:00

13 lines
429 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 RedirectToPage("Index");
}
}