diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index 7e4ae8f..71f8451 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -45,7 +45,8 @@ public class AuthenticationController : Controller { // Create session Session session = new Session { User = user, - ApiToken = Guid.NewGuid().ToString() + ApiToken = Guid.NewGuid().ToString(), + CreatedAt = DateTime.Now }; ctx.Sessions.Add(session); @@ -148,7 +149,8 @@ public class AuthenticationController : Controller { // Create session Session session = new Session { Viking = viking, - ApiToken = Guid.NewGuid().ToString() + ApiToken = Guid.NewGuid().ToString(), + CreatedAt = DateTime.Now, }; ctx.Sessions.Add(session); ctx.SaveChanges(); diff --git a/src/Model/Session.cs b/src/Model/Session.cs index 9fb9584..619970f 100644 --- a/src/Model/Session.cs +++ b/src/Model/Session.cs @@ -9,6 +9,8 @@ public class Session { public string? VikingId { get; set; } + public DateTime? CreatedAt { get; set; } + public virtual User? User { get; set; } public virtual Viking? Viking { get; set; }