Add CurrentUserSessionService for session ID retrieval

Introduces ICurrentUserSessionService and its implementation to provide access to the current user's session ID via the 'sid' claim. Registers the service in DI and adds comprehensive unit tests to validate correct and error scenarios.
This commit is contained in:
Artemy
2025-07-25 18:07:05 +07:00
parent ce630fbe0a
commit 751c30dedd
5 changed files with 145 additions and 1 deletions
@@ -64,6 +64,7 @@ public static class ConfigurationProgramExtensions
services.AddHttpContextAccessor(); // it's very important for CurrentUserService
services.AddScoped<ICurrentUserService, CurrentUserService>();
services.AddScoped<ICurrentUserSessionService, CurrentUserSessionService>();
services.AddMemoryCache();
services.AddScoped<IPingHandlerService, PingHandlerService>();