From 9aa60dfc23f38a37ec70da47aea0f3d111b69f71 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 30 Aug 2016 14:49:21 +0100 Subject: [PATCH] When logging out as admin remove the username from the session --- PlexRequests.UI/Modules/LoginModule.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PlexRequests.UI/Modules/LoginModule.cs b/PlexRequests.UI/Modules/LoginModule.cs index 8c3bd550d..0099a9ec2 100644 --- a/PlexRequests.UI/Modules/LoginModule.cs +++ b/PlexRequests.UI/Modules/LoginModule.cs @@ -61,7 +61,14 @@ namespace PlexRequests.UI.Modules return View["Index", model]; }; - Get["/logout"] = x => this.LogoutAndRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/" : "~/"); + Get["/logout"] = x => + { + if (Session[SessionKeys.UsernameKey] != null) + { + Session.Delete(SessionKeys.UsernameKey); + } + return this.LogoutAndRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/" : "~/"); + }; Post["/login"] = x => {