diff options
Diffstat (limited to 'Software/Visual_Studio')
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs | 8 | ||||
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.Portal/Models/SessionUser.cs | 4 |
2 files changed, 10 insertions, 2 deletions
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 |
