mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05: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();
|
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 organizationSignup = model.ToOrganizationSignup(user);
|
||||||
var result = await _organizationService.SignUpAsync(organizationSignup);
|
var result = await _organizationService.SignUpAsync(organizationSignup);
|
||||||
return new OrganizationResponseModel(result.Item1);
|
return new OrganizationResponseModel(result.Item1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user