diff --git a/Components/Pages/Logout.razor b/Components/Pages/Logout.razor
new file mode 100644
index 0000000..3d8197a
--- /dev/null
+++ b/Components/Pages/Logout.razor
@@ -0,0 +1,19 @@
+@page "/logout"
+@using Microsoft.AspNetCore.Authentication
+@using Microsoft.AspNetCore.Authentication.Cookies
+
+@inject IHttpContextAccessor HttpContextAccessor;
+@inject NavigationManager Navigation;
+
+
How did you get here?
+ +@code { + protected override async Task OnInitializedAsync() { + var context = HttpContextAccessor.HttpContext; + if (context is null) throw new ArgumentException("HttpContext"); + await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + Navigation.NavigateTo("/", true); + } +} diff --git a/Pages/Logout.cshtml b/Pages/Logout.cshtml deleted file mode 100644 index 353898e..0000000 --- a/Pages/Logout.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@page -@model JustShortIt.Pages.LogoutModel -@{ - ViewData["Title"] = "Logout"; -} - -How did you get here?
- diff --git a/Pages/Logout.cshtml.cs b/Pages/Logout.cshtml.cs deleted file mode 100644 index 84f8a56..0000000 --- a/Pages/Logout.cshtml.cs +++ /dev/null @@ -1,13 +0,0 @@ -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