Files

12 lines
555 B
C#
Raw Permalink Normal View History

namespace UCVL.VPNPlus;
// A reused account/token must not accept a response from an earlier login.
// No credentials or session identifiers are persisted by this predicate.
internal static class SessionOperationFence
{
internal static bool IsCurrent(long expectedRevision, long currentRevision,
string? expectedToken, string? currentToken, bool exiting) => !exiting
&& expectedRevision == currentRevision && !string.IsNullOrWhiteSpace(expectedToken)
&& string.Equals(expectedToken, currentToken, StringComparison.Ordinal);
}