1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 00:23:40 +00:00

fix(auth-validator): [PM-22975] Client Version Validator - Updated validator to return false on null.

This commit is contained in:
Patrick Pimentel
2025-12-04 16:54:45 -05:00
parent 2ed458d5d4
commit d706796fc3

View File

@@ -30,9 +30,12 @@ public class ClientVersionValidator(
public async Task<bool> ValidateAsync(User? user, CustomValidatorRequestContext requestContext)
{
// Do this nullish check because the base request validator currently is not
// strict null checking. Once that gets fixed then we can see about making
// the user not nullish checked. If they are null then the validator should fail.
if (user == null)
{
return true;
return false;
}
Version? clientVersion = currentContext.ClientVersion;