1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 21:18:13 -05:00
bitwarden/src/Billing/Controllers/JobsController.cs
2017-08-12 23:06:49 -04:00

39 lines
1.1 KiB
C#

using Bit.Core.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
namespace Bit.Billing.Controllers
{
[Route("jobs")]
public class JobsController : Controller
{
private readonly BillingSettings _billingSettings;
private readonly IOrganizationService _organizationService;
private readonly IUserService _userService;
public JobsController(
IOptions<BillingSettings> billingSettings,
IOrganizationService organizationService,
IUserService userService)
{
_billingSettings = billingSettings?.Value;
_organizationService = organizationService;
_userService = userService;
}
[HttpPost("expirations")]
public async Task<IActionResult> PostExpirations([FromQuery] string key)
{
if(key != _billingSettings.JobsKey)
{
return new BadRequestResult();
}
// TODO check for all users/orgs that are expired and disable them
return new OkResult();
}
}
}