This commit is contained in:
john 2025-05-14 23:53:00 +02:00
parent baea64229b
commit 0dc41337da
36 changed files with 324 additions and 95 deletions

View file

@ -0,0 +1,19 @@
namespace Femto.Modules.Auth.Models;
public class UserSession
{
private static TimeSpan SessionTimeout = TimeSpan.FromMinutes(30);
public string Id { get; private set; }
public DateTimeOffset Expires { get; private set; }
private UserSession() {}
public static UserSession Create()
{
return new()
{
Id = Convert.ToBase64String(System.Security.Cryptography.RandomNumberGenerator.GetBytes(32)),
Expires = DateTimeOffset.Now + SessionTimeout
};
}
}