From 6887d33fe260052706baccd506fe3b312b2e1642 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Mon, 7 Feb 2022 20:58:32 +0000 Subject: [PATCH] Add logout feature --- Controllers/UserController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Controllers/UserController.cs b/Controllers/UserController.cs index c79bd27..20af9ec 100644 --- a/Controllers/UserController.cs +++ b/Controllers/UserController.cs @@ -89,6 +89,11 @@ namespace EFB.Controllers } + public IActionResult Logout(){ + HttpContext.Session.SetObject("User", null); + return RedirectToAction("Index", "Home"); + } + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() {