Robert Marshall пре 3 година
родитељ
комит
0578405703

+ 5 - 0
src/Website/Controllers/AccountController.cs

@@ -56,5 +56,10 @@ namespace Website.Controllers {
 				? RedirectToAction(nameof(Index))
 				: Redirect(returnUrl);
 		}
+
+		public async Task<IActionResult> Logout() {
+			await HttpContext.SignOutAsync();
+			return RedirectToAction(nameof(Login));
+		}
 	}
 }

+ 3 - 2
src/Website/Views/Account/Index.cshtml

@@ -1,11 +1,12 @@
-@model AccountViewModel
+@model AccountViewModel
 
 @{
 	ViewBag.Title = "Account";
 	Layout = "_Layout";
 }
 
-<h2>Admin Panel</h2>
+<a asp-action="Logout">Logout</a>
+
 <div>
 	<a asp-controller="Admin" asp-action="ApiKeys">Manage API Keys</a>
 </div>