From d31998b8effd77289a861b97efd0c934d21a8249 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 21 May 2025 13:55:04 +0200 Subject: [PATCH] fix --- Femto.Api/CurrentUserContext.cs | 20 +------------------- Femto.Common/ICurrentUserContext.cs | 1 - 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Femto.Api/CurrentUserContext.cs b/Femto.Api/CurrentUserContext.cs index 1164eb0..1455406 100644 --- a/Femto.Api/CurrentUserContext.cs +++ b/Femto.Api/CurrentUserContext.cs @@ -4,23 +4,5 @@ namespace Femto.Api; internal class CurrentUserContext : ICurrentUserContext { - private CurrentUser? _currentUser; - - public CurrentUser? TryGetUserCurrentUser() => this._currentUser; - - public bool HasUser => this._currentUser is not null; - - public CurrentUser CurrentUser - { - get - { - if (_currentUser is null) - throw new InvalidOperationException( - "don't access current user if not authenticated" - ); - - return _currentUser; - } - set => _currentUser = value; - } + public CurrentUser? CurrentUser { get; } } diff --git a/Femto.Common/ICurrentUserContext.cs b/Femto.Common/ICurrentUserContext.cs index f09e417..a7233e0 100644 --- a/Femto.Common/ICurrentUserContext.cs +++ b/Femto.Common/ICurrentUserContext.cs @@ -2,7 +2,6 @@ namespace Femto.Common; public interface ICurrentUserContext { - bool HasUser { get; } CurrentUser? CurrentUser { get; } }