Refactor app architecture and clean local artifacts
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Backend.Domain;
|
||||
|
||||
namespace Backend.Security;
|
||||
|
||||
public static class HttpContextSessionExtensions
|
||||
{
|
||||
private const string SessionItemKey = "__current_session";
|
||||
|
||||
public static void SetCurrentSession(this HttpContext context, UserSession session) =>
|
||||
context.Items[SessionItemKey] = session;
|
||||
|
||||
public static UserSession? GetCurrentSession(this HttpContext context) =>
|
||||
context.Items.TryGetValue(SessionItemKey, out var value) ? value as UserSession : null;
|
||||
}
|
||||
Reference in New Issue
Block a user