From 117c15a43970de1f5dc667d5672e92622ba6cae1 Mon Sep 17 00:00:00 2001 From: hictooth Date: Sat, 17 Jun 2023 23:06:09 +0100 Subject: [PATCH] fix session saving --- src/Controllers/Common/AuthenticationController.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index 3a23995..5a437e9 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -112,18 +112,20 @@ public class AuthenticationController : Controller { [HttpPost] [Produces("application/xml")] [Route("AuthenticationWebService.asmx/LoginChild")] - [DecryptRequest("childUserId")] + [DecryptRequest("childUserID")] [EncryptResponse] - public IActionResult LoginChild([FromForm] string parentApiToken) { + public IActionResult LoginChild10([FromForm] string parentApiToken) { User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == parentApiToken)?.User; if (user is null) { - // Return empty response return Ok(); } // Find the viking - string? childUserId = Request.Form["parentLoginData"]; - Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Id == childUserId); + string? childUserID = Request.Form["childUserID"]; + Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Id == childUserID); + if (viking is null) { + return Ok(); + } // Create session Session session = new Session {