Changed where the cached system identity expiry exception is thrown

This commit is contained in:
Jordan Brown
2018-10-11 10:55:06 -04:00
parent e120f99fde
commit 5ce7cedd11
2 changed files with 1 additions and 7 deletions
@@ -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!");
}
}
}