From a6f235e12e50c688608d276f57f8035c449c3bf9 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 11 Oct 2018 10:43:31 -0400 Subject: [PATCH] Fixes AuthenticationContextFactory time validation stuff --- .../Security/AuthenticationContextFactory.cs | 4 ++-- .../Security/IAuthenticationContextFactory.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs index 93ffeac801..12b3dbf900 100644 --- a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs +++ b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs @@ -42,7 +42,7 @@ namespace Tgstation.Server.Host.Security } /// - public async Task CreateAuthenticationContext(long userId, long? instanceId, DateTimeOffset validBefore, CancellationToken cancellationToken) + public async Task CreateAuthenticationContext(long userId, long? instanceId, DateTimeOffset validAfter, CancellationToken cancellationToken) { if (CurrentAuthenticationContext != null) throw new InvalidOperationException("Authentication context has already been loaded"); @@ -72,7 +72,7 @@ namespace Tgstation.Server.Host.Security } else { - if (user.LastPasswordUpdate.HasValue && user.LastPasswordUpdate > validBefore) + if (user.LastPasswordUpdate.HasValue && user.LastPasswordUpdate < validAfter) { CurrentAuthenticationContext = new AuthenticationContext(); return; diff --git a/src/Tgstation.Server.Host/Security/IAuthenticationContextFactory.cs b/src/Tgstation.Server.Host/Security/IAuthenticationContextFactory.cs index ccc1b403de..437ddae0d0 100644 --- a/src/Tgstation.Server.Host/Security/IAuthenticationContextFactory.cs +++ b/src/Tgstation.Server.Host/Security/IAuthenticationContextFactory.cs @@ -19,7 +19,7 @@ namespace Tgstation.Server.Host.Security /// /// The of the /// The of the operation - /// The the resulting 's password must be valid before + /// The the resulting 's password must be valid after /// The for the operation /// A representing the running operation Task CreateAuthenticationContext(long userId, long? instanceId, DateTimeOffset validBefore, CancellationToken cancellationToken);