1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-11 21:03:47 -05:00

[BEEEP] Add explicit error message when uploading the wrong license type (#1831)

This commit is contained in:
Oscar Hinton
2022-02-07 09:43:00 +01:00
committed by GitHub
parent 240b6e7463
commit cd61c826f9
5 changed files with 32 additions and 0 deletions

View File

@ -1030,6 +1030,12 @@ namespace Bit.Core.Services
throw new InvalidOperationException("Licenses require self hosting.");
}
if (license?.LicenseType != null && license.LicenseType != LicenseType.User)
{
throw new BadRequestException("Organization licenses cannot be applied to a user. "
+ "Upload this license from the Organization settings page.");
}
if (license == null || !_licenseService.VerifyLicense(license))
{
throw new BadRequestException("Invalid license.");