mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
public and private keys added to db and user domain. added account APIs got getting and putting keys.
This commit is contained in:
@ -263,6 +263,22 @@ namespace Bit.Api.Controllers
|
||||
return response;
|
||||
}
|
||||
|
||||
[HttpPut("keys")]
|
||||
[HttpPost("keys")]
|
||||
public async Task<KeysResponseModel> PutKeys([FromBody]KeysRequestModel model)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
await _userService.SaveUserAsync(model.ToUser(user));
|
||||
return new KeysResponseModel(user);
|
||||
}
|
||||
|
||||
[HttpGet("keys")]
|
||||
public async Task<KeysResponseModel> GetKeys()
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
return new KeysResponseModel(user);
|
||||
}
|
||||
|
||||
[HttpPost("delete")]
|
||||
public async Task PostDelete([FromBody]DeleteAccountRequestModel model)
|
||||
{
|
||||
|
Reference in New Issue
Block a user