mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Added additional validation to ensure that the license type is accurate
This commit is contained in:
parent
8d78c17bd0
commit
bcc80ca3f9
@ -648,6 +648,12 @@ public class OrganizationService : IOrganizationService
|
||||
OrganizationLicense license, User owner, string ownerKey, string collectionName, string publicKey,
|
||||
string privateKey)
|
||||
{
|
||||
if (license.LicenseType != LicenseType.Organization)
|
||||
{
|
||||
throw new BadRequestException("Premium licenses cannot be applied to an organization. " +
|
||||
"Upload this license from your personal account settings page.");
|
||||
}
|
||||
|
||||
var canUse = license.CanUse(_globalSettings, _licensingService, out var exception);
|
||||
if (!canUse)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user