mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-12 00:38:48 -07:00
fix session saving
This commit is contained in:
parent
d4517b459b
commit
117c15a439
@ -112,18 +112,20 @@ public class AuthenticationController : Controller {
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Produces("application/xml")]
|
[Produces("application/xml")]
|
||||||
[Route("AuthenticationWebService.asmx/LoginChild")]
|
[Route("AuthenticationWebService.asmx/LoginChild")]
|
||||||
[DecryptRequest("childUserId")]
|
[DecryptRequest("childUserID")]
|
||||||
[EncryptResponse]
|
[EncryptResponse]
|
||||||
public IActionResult LoginChild([FromForm] string parentApiToken) {
|
public IActionResult LoginChild10([FromForm] string parentApiToken) {
|
||||||
User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == parentApiToken)?.User;
|
User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == parentApiToken)?.User;
|
||||||
if (user is null) {
|
if (user is null) {
|
||||||
// Return empty response
|
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the viking
|
// Find the viking
|
||||||
string? childUserId = Request.Form["parentLoginData"];
|
string? childUserID = Request.Form["childUserID"];
|
||||||
Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Id == childUserId);
|
Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Id == childUserID);
|
||||||
|
if (viking is null) {
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
// Create session
|
// Create session
|
||||||
Session session = new Session {
|
Session session = new Session {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user