mirror of
https://github.com/bitwarden/server
synced 2026-01-02 08:33:48 +00:00
fix(auth-validator): [PM-22975] Client Version Validator - Made enough changes so that it's ready for review by KM
This commit is contained in:
@@ -25,11 +25,14 @@ public class ClientVersionValidator(
|
||||
return true;
|
||||
}
|
||||
|
||||
Version clientVersion = currentContext.ClientVersion;
|
||||
Version? clientVersion = currentContext.ClientVersion;
|
||||
Version? minVersion = await getMinimumClientVersionForUserQuery.Run(user);
|
||||
|
||||
// Allow through if headers are missing.
|
||||
if (minVersion == null)
|
||||
// The minVersion should never be null because of where this validator is run. The user would
|
||||
// have been determined to be null prior to reaching this point, but it is defensive programming
|
||||
// to check for nullish values in case validators were to ever be reordered.
|
||||
if (clientVersion == null || minVersion == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user