1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

Check canScale when scaling for sso (#1661)

* Check canScale when scaling for sso

* PR review

Use AutoAddSeats to add seats in a consistent way.
This requires moving user check out of that method.

* User logic moved out of method
This commit is contained in:
Matt Gibson
2021-10-25 10:19:37 -05:00
committed by GitHub
parent c5d5601464
commit 8f0115e62f
4 changed files with 14 additions and 31 deletions

View File

@ -483,12 +483,7 @@ namespace Bit.Sso.Controllers
throw new Exception("Cannot autoscale on self-hosted instance.");
}
var paymentIntentClientSecret = await _organizationService.AdjustSeatsAsync(orgId, 1, prorationDate);
organization = await _organizationRepository.GetByIdAsync(orgId);
if (!string.IsNullOrEmpty(paymentIntentClientSecret))
{
throw new Exception("Stripe payment required client-side confirmation.");
}
await _organizationService.AutoAddSeatsAsync(organization, 1, prorationDate);
}
catch (Exception e)
{