SoftwayWeb/Controllers/PortaleController.cs
2024-06-25 08:58:24 +02:00

40 lines
1008 B
C#

using Microsoft.AspNetCore.Mvc;
using NuGet.Common;
namespace SoftwayWeb.Controllers
{
public class PortaleController : Controller
{
string apiUrl = string.Empty;
string token = string.Empty;
string errMes = string.Empty;
private readonly IConfiguration _configuration;
HttpClient client;
SessionHelper helper;
public PortaleController(IConfiguration configuration)
{
_configuration = configuration;
client = new HttpClient();
var key = _configuration["ApplicationInsights:rootUrlApi"];
apiUrl = key;
}
public IActionResult Index()
{
helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
else
{
return View();
}
}
}
}