1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-01 08:40:33 -05:00

Invert two-factor compliance check in RestoreOrganizationUserCommand to ensure correct validation of organization user policies.

This commit is contained in:
Rui Tome 2025-05-26 13:14:10 +01:00
parent 019b39feac
commit 451711bfe0
No known key found for this signature in database
GPG Key ID: 526239D96A8EC066

View File

@ -274,7 +274,7 @@ public class RestoreOrganizationUserCommand(
// Enforce 2FA Policy of organization user is trying to join // Enforce 2FA Policy of organization user is trying to join
if (!userHasTwoFactorEnabled) if (!userHasTwoFactorEnabled)
{ {
twoFactorCompliant = await IsTwoFactorRequiredForOrganizationAsync(userId, orgUser.OrganizationId); twoFactorCompliant = !await IsTwoFactorRequiredForOrganizationAsync(userId, orgUser.OrganizationId);
} }
var user = await userRepository.GetByIdAsync(userId); var user = await userRepository.GetByIdAsync(userId);