Michele: Aggiunto logout su controller e su pagina

This commit is contained in:
michele 2024-07-25 15:35:19 +02:00
parent 0591c843c1
commit 1287caaa54
3 changed files with 22 additions and 2 deletions

View File

@ -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
}
}

View File

@ -12,7 +12,8 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SoftwayWeb</a>
@* <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SoftwayWeb</a> *@
<label class="navbar-brand">SoftwayWeb</label>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>

View File

@ -18,11 +18,16 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<ul class="navbar-nav flex-grow-1" style="width:95%">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Giri" asp-action="Index">Giri di consegna</a>
</li>
</ul>
<ul class="navbar-nav flex-grow-1" style="width:5%">
<li class ="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Login" asp-action="Logout">Logout</a>
</li>
</ul>
</div>
</div>
</nav>