mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Changed where the cached system identity expiry exception is thrown
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user