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:
parent
b429f6908d
commit
d7e45fe0a3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user