1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-28 17:57:37 +01:00

added server validation for plan selection (#924)

This commit is contained in:
Addison Beck 2020-09-09 12:10:33 -04:00 committed by GitHub
parent b429f6908d
commit d7e45fe0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,6 +150,12 @@ namespace Bit.Api.Controllers
throw new UnauthorizedAccessException();
}
var plan = StaticStore.Plans.FirstOrDefault(plan => plan.Type == model.PlanType);
if (plan == null || plan.LegacyYear != null)
{
throw new Exception("Invalid plan selected.");
}
var organizationSignup = model.ToOrganizationSignup(user);
var result = await _organizationService.SignUpAsync(organizationSignup);
return new OrganizationResponseModel(result.Item1);