mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
added installation id to current context.
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Exceptions;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
@ -10,16 +12,24 @@ namespace Bit.Api.Controllers
|
||||
public class PushController : Controller
|
||||
{
|
||||
private readonly IPushRegistrationService _pushRegistrationService;
|
||||
private readonly CurrentContext _currentContext;
|
||||
|
||||
public PushController(
|
||||
IPushRegistrationService pushRegistrationService)
|
||||
IPushRegistrationService pushRegistrationService,
|
||||
CurrentContext currentContext)
|
||||
{
|
||||
_currentContext = currentContext;
|
||||
_pushRegistrationService = pushRegistrationService;
|
||||
}
|
||||
|
||||
[HttpGet("register")]
|
||||
public Object Register()
|
||||
{
|
||||
if(!_currentContext.InstallationId.HasValue)
|
||||
{
|
||||
throw new BadRequestException("bad request.");
|
||||
}
|
||||
|
||||
return new { Foo = "bar" };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user