From 1287caaa54c6d846392e99682768ae362e4cdcbc Mon Sep 17 00:00:00 2001 From: michele Date: Thu, 25 Jul 2024 15:35:19 +0200 Subject: [PATCH] Michele: Aggiunto logout su controller e su pagina --- Controllers/LoginController.cs | 14 ++++++++++++++ Views/Shared/_Layout.cshtml | 3 ++- Views/Shared/_LayoutAreaRis.cshtml | 7 ++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Controllers/LoginController.cs b/Controllers/LoginController.cs index 5bedcbe..65c0f6b 100644 --- a/Controllers/LoginController.cs +++ b/Controllers/LoginController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using NuGet.Common; using SoftwayWeb.Models; using System.Text; @@ -79,5 +80,18 @@ namespace SoftwayWeb.Controllers return View(); } } + + #region Logout + + public IActionResult Logout() + { + helper = new SessionHelper(this); + helper.ClearFormatedKey("tok"); + + return RedirectToAction("Login","Login"); + } + + + #endregion Logout } } diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 50190e2..0c0436d 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -12,7 +12,8 @@