1
0
mirror of https://github.com/bitwarden/server synced 2025-12-26 05:03:18 +00:00

Turn on file scoped namespaces (#2225)

This commit is contained in:
Justin Baur
2022-08-29 14:53:16 -04:00
committed by GitHub
parent 7c4521e0b4
commit 34fb4cca2a
1206 changed files with 73816 additions and 75022 deletions

View File

@@ -4,31 +4,30 @@ using Bit.Core.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Controllers
namespace Bit.Api.Controllers;
[Route("users")]
[Authorize("Application")]
public class UsersController : Controller
{
[Route("users")]
[Authorize("Application")]
public class UsersController : Controller
private readonly IUserRepository _userRepository;
public UsersController(
IUserRepository userRepository)
{
private readonly IUserRepository _userRepository;
_userRepository = userRepository;
}
public UsersController(
IUserRepository userRepository)
[HttpGet("{id}/public-key")]
public async Task<UserKeyResponseModel> Get(string id)
{
var guidId = new Guid(id);
var key = await _userRepository.GetPublicKeyAsync(guidId);
if (key == null)
{
_userRepository = userRepository;
throw new NotFoundException();
}
[HttpGet("{id}/public-key")]
public async Task<UserKeyResponseModel> Get(string id)
{
var guidId = new Guid(id);
var key = await _userRepository.GetPublicKeyAsync(guidId);
if (key == null)
{
throw new NotFoundException();
}
return new UserKeyResponseModel(guidId, key);
}
return new UserKeyResponseModel(guidId, key);
}
}