Buff system identity cache expiry times

This commit is contained in:
Jordan Brown
2018-10-11 11:44:01 -04:00
parent 6706f6d290
commit 5ec9784d9d
@@ -141,7 +141,13 @@ namespace Tgstation.Server.Host.Controllers
var token = await tokenFactory.CreateToken(user, cancellationToken).ConfigureAwait(false);
if (identity != null)
identityCache.CacheSystemIdentity(user, identity, token.ExpiresAt.Value.AddMinutes(1)); //expire the identity slightly after the auth token in case of lag
{
//expire the identity slightly after the auth token in case of lag
var identExpiry = token.ExpiresAt.Value;
identExpiry += tokenFactory.ValidationParameters.ClockSkew;
identExpiry += TimeSpan.FromSeconds(15);
identityCache.CacheSystemIdentity(user, identity, identExpiry);
}
Logger.LogDebug("Successfully logged in user {0}!", user.Id);