From 9ba1902ee9dbac3b3c48d735b3bbcc3ba867dd2e Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 7 Sep 2025 06:47:24 +0300 Subject: Added seesion, chat history on ADX... --- .../Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs | 8 ++++++-- Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Web') diff --git a/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs b/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs index dff8a140e..38eaaf4b3 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs +++ b/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs @@ -171,8 +171,9 @@ namespace Tango.Portal.Controllers public ActionResult AI() { if (!SessionUser.IsTwineUser) return RedirectToAction(nameof(Login)); - String session = SimpleCryptoHelper.Encrypt(JsonConvert.SerializeObject(new { UserName = SessionUser.Name, Expires = DateTime.UtcNow.AddHours(1) })); - return new RedirectResult($"https://ai.twine-srv.com?session={session}"); + SessionUser.Expires = DateTime.UtcNow.AddHours(1); + String json = SimpleCryptoHelper.Encrypt(JsonConvert.SerializeObject(SessionUser)); + return new RedirectResult($"https://ai.twine-srv.com?session={json}"); } public ActionResult Docs() @@ -241,6 +242,9 @@ namespace Tango.Portal.Controllers SessionUser.IsAuthenticated = true; SessionUser.IsTwineUser = user.Organization.Name == "Twine"; SessionUser.Name = user.Contact.FirstName; + SessionUser.FullName = user.Contact.FullName; + SessionUser.Email = user.Email; + SessionUser.Organization = user.Organization.Name; return RedirectToAction(nameof(Index)); } diff --git a/Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs b/Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs index e38f11c77..83323b0ad 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs +++ b/Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs @@ -12,5 +12,9 @@ namespace Tango.Portal.Models public String Name { get; set; } public bool IsTwineUser { get; set; } + public string Email { get; set; } + public string Organization { get; set; } + public string FullName { get; set; } + public DateTime Expires { get; set; } } } \ No newline at end of file -- cgit v1.3.1