From 132cc7a54c944010065526a87d31ee66818f3cd3 Mon Sep 17 00:00:00 2001 From: dingo Date: Thu, 4 Dec 2025 13:49:46 -0500 Subject: [PATCH] fix session --- Api/AuthApiController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Api/AuthApiController.cs b/Api/AuthApiController.cs index bee5114..5cd62c2 100644 --- a/Api/AuthApiController.cs +++ b/Api/AuthApiController.cs @@ -55,10 +55,10 @@ public class AuthApiController : ControllerBase var session = new Session { AccountId = account.Id, - TokenHash = tokenHash, + TokenHash = tokenHash.ToString(), CreatedAt = DateTime.UtcNow, ExpiresAt = DateTime.UtcNow.AddDays(7), // 7 day expiry for API tokens - IpAddress = HttpContext.Connection.RemoteIpAddress?.ToString(), + CreatedIp = HttpContext.Connection.RemoteIpAddress?.ToString(), UserAgent = Request.Headers.UserAgent.ToString() }; @@ -87,7 +87,7 @@ public class AuthApiController : ControllerBase var tokenHash = HashToken(token); var session = await _db.Sessions - .FirstOrDefaultAsync(s => s.TokenHash == tokenHash && s.RevokedAt == null); + .FirstOrDefaultAsync(s => s.TokenHash == tokenHash.ToString() && s.RevokedAt == null); if (session == null) return NotFound(new { error = "Session not found" });