diff --git a/Auth/Models/Token.cs b/Auth/Models/Token.cs index 42e2062..2516836 100644 --- a/Auth/Models/Token.cs +++ b/Auth/Models/Token.cs @@ -40,12 +40,13 @@ public class Token /// /// Checks if the token is currently valid based on the current time. + /// Converts stored timestamps to UTC before comparing to avoid DateTimeKind issues. /// public bool IsValid => ValidFrom.HasValue && ValidTo.HasValue && !string.IsNullOrWhiteSpace(Value) && !string.IsNullOrWhiteSpace(Tin) && - DateTime.UtcNow >= ValidFrom.Value && - DateTime.UtcNow <= ValidTo.Value; -} \ No newline at end of file + (DateTime.UtcNow.AddSeconds(1)) >= ValidFrom.Value.ToUniversalTime() && + DateTime.UtcNow <= ValidTo.Value.ToUniversalTime(); +}