mirror of
https://github.com/bitwarden/server.git
synced 2024-12-23 17:07:42 +01:00
Ensure that users are confirmed status (#1033)
This commit is contained in:
parent
7eaf7ab770
commit
01d4d97ef1
@ -52,7 +52,8 @@ namespace Bit.Portal
|
|||||||
|
|
||||||
// TODO: maybe make loading orgs Lazy<T> somehow?
|
// TODO: maybe make loading orgs Lazy<T> somehow?
|
||||||
var orgUserRepo = _serviceProvider.GetRequiredService<IOrganizationUserRepository>();
|
var orgUserRepo = _serviceProvider.GetRequiredService<IOrganizationUserRepository>();
|
||||||
var userOrgs = await orgUserRepo.GetManyDetailsByUserAsync(UserId.Value);
|
var userOrgs = await orgUserRepo.GetManyDetailsByUserAsync(UserId.Value,
|
||||||
|
Core.Enums.OrganizationUserStatusType.Confirmed);
|
||||||
OrganizationsDetails = userOrgs.ToList();
|
OrganizationsDetails = userOrgs.ToList();
|
||||||
Organizations = userOrgs.Select(ou => new CurrentContentOrganization
|
Organizations = userOrgs.Select(ou => new CurrentContentOrganization
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,8 @@ namespace Bit.Api.Controllers
|
|||||||
public async Task<ListResponseModel<ProfileOrganizationResponseModel>> GetUser()
|
public async Task<ListResponseModel<ProfileOrganizationResponseModel>> GetUser()
|
||||||
{
|
{
|
||||||
var userId = _userService.GetProperUserId(User).Value;
|
var userId = _userService.GetProperUserId(User).Value;
|
||||||
var organizations = await _organizationUserRepository.GetManyDetailsByUserAsync(userId);
|
var organizations = await _organizationUserRepository.GetManyDetailsByUserAsync(userId,
|
||||||
|
OrganizationUserStatusType.Confirmed);
|
||||||
var responses = organizations.Select(o => new ProfileOrganizationResponseModel(o));
|
var responses = organizations.Select(o => new ProfileOrganizationResponseModel(o));
|
||||||
return new ListResponseModel<ProfileOrganizationResponseModel>(responses);
|
return new ListResponseModel<ProfileOrganizationResponseModel>(responses);
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,8 @@ namespace Bit.Core.IdentityServer
|
|||||||
if (ssoOrgs.Any())
|
if (ssoOrgs.Any())
|
||||||
{
|
{
|
||||||
// Parse users orgs and determine if require sso policy is enabled
|
// Parse users orgs and determine if require sso policy is enabled
|
||||||
var userOrgs = await _organizationUserRepository.GetManyDetailsByUserAsync(user.Id);
|
var userOrgs = await _organizationUserRepository.GetManyDetailsByUserAsync(user.Id,
|
||||||
|
OrganizationUserStatusType.Confirmed);
|
||||||
foreach (var userOrg in userOrgs.Where(o => o.Enabled && o.UseSso))
|
foreach (var userOrg in userOrgs.Where(o => o.Enabled && o.UseSso))
|
||||||
{
|
{
|
||||||
var orgPolicy = await _policyRepository.GetByOrganizationIdTypeAsync(userOrg.OrganizationId,
|
var orgPolicy = await _policyRepository.GetByOrganizationIdTypeAsync(userOrg.OrganizationId,
|
||||||
|
Loading…
Reference in New Issue
Block a user