1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

[PM-6664] base request validator - Two Factor flows integration tests (#4643)

* initial commit added two factor tests

* initial commit

* updated two factor tests

* fixed formatting
This commit is contained in:
Ike
2024-09-06 08:05:25 -07:00
committed by GitHub
parent c0a4ba8de1
commit fc587847c3
3 changed files with 500 additions and 92 deletions

View File

@ -350,9 +350,8 @@ public abstract class BaseRequestValidator<T> where T : class
(await _userManager.GetValidTwoFactorProvidersAsync(user)).Count > 0;
Organization firstEnabledOrg = null;
var orgs = (await CurrentContext.OrganizationMembershipAsync(_organizationUserRepository, user.Id))
.ToList();
if (orgs.Any())
var orgs = (await CurrentContext.OrganizationMembershipAsync(_organizationUserRepository, user.Id)).ToList();
if (orgs.Count > 0)
{
var orgAbilities = await _applicationCacheService.GetOrganizationAbilitiesAsync();
var twoFactorOrgs = orgs.Where(o => OrgUsing2fa(orgAbilities, o.Id));