mirror of
https://github.com/bitwarden/server.git
synced 2025-04-10 15:48:13 -05:00
Use consistent exception type
This commit is contained in:
parent
84447bfc05
commit
a42f21159f
@ -3,7 +3,6 @@
|
|||||||
using Bit.Core.AdminConsole.Repositories;
|
using Bit.Core.AdminConsole.Repositories;
|
||||||
using Bit.Core.Services;
|
using Bit.Core.Services;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using BadRequestException = Bit.Core.Exceptions.BadRequestException;
|
|
||||||
|
|
||||||
namespace Bit.Api.AdminConsole.Authorization;
|
namespace Bit.Api.AdminConsole.Authorization;
|
||||||
|
|
||||||
@ -32,7 +31,7 @@ public class OrganizationRequirementHandler(
|
|||||||
var userId = userService.GetProperUserId(httpContext.User);
|
var userId = userService.GetProperUserId(httpContext.User);
|
||||||
if (userId == null)
|
if (userId == null)
|
||||||
{
|
{
|
||||||
throw new BadRequestException("This method should only be called on the private api with a logged in user.");
|
throw new InvalidOperationException("This method should only be called on the private api with a logged in user.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Task<bool> IsProviderUserForOrg() => httpContextAccessor.HttpContext.IsProviderUserForOrgAsync(providerUserRepository, userId.Value, organizationId);
|
Task<bool> IsProviderUserForOrg() => httpContextAccessor.HttpContext.IsProviderUserForOrgAsync(providerUserRepository, userId.Value, organizationId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user