diff --git a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs index 12b3dbf900..eaea9fa20d 100644 --- a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs +++ b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs @@ -65,11 +65,7 @@ namespace Tgstation.Server.Host.Security ISystemIdentity systemIdentity; if (user.SystemIdentifier != null) - { systemIdentity = identityCache.LoadCachedIdentity(user); - if (systemIdentity == null) - throw new InvalidOperationException("Cached system identity has expired!"); - } else { if (user.LastPasswordUpdate.HasValue && user.LastPasswordUpdate < validAfter) diff --git a/src/Tgstation.Server.Host/Security/IdentityCache.cs b/src/Tgstation.Server.Host/Security/IdentityCache.cs index 3450683f0d..8f4d6a2517 100644 --- a/src/Tgstation.Server.Host/Security/IdentityCache.cs +++ b/src/Tgstation.Server.Host/Security/IdentityCache.cs @@ -70,11 +70,9 @@ namespace Tgstation.Server.Host.Security if (user == null) throw new ArgumentNullException(nameof(user)); lock (cachedIdentities) - { if (cachedIdentities.TryGetValue(user.Id, out var identity)) return identity.SystemIdentity; - return null; - } + throw new InvalidOperationException("Cached system identity has expired!"); } } }