From 216e7a47bef478a7b6a6a3c7b3e1fb208def6a49 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 5 Dec 2025 14:58:03 +0100 Subject: [PATCH] Cleanup --- dev/docker-compose.yml | 6 ++---- src/Api/Auth/Controllers/AccountsController.cs | 10 +++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 6d8ec01d5b..3554306ddb 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -12,7 +12,7 @@ services: - mssql_dev_data:/var/opt/mssql - ../util/Migrator:/mnt/migrator/ - ./helpers/mssql:/mnt/helpers - - mssql_data:/mssql:/mnt/data + - ./.data/mssql:/mnt/data ports: - "1433:1433" profiles: @@ -26,7 +26,7 @@ services: - "10001:10001" - "10002:10002" volumes: - - azurite_data:/azurite:/data + - ./.data/azurite:/data profiles: - storage - cloud @@ -152,5 +152,3 @@ volumes: mariadb_dev_data: rabbitmq_data: redis_data: - azurite_data: - mssql_data: diff --git a/src/Api/Auth/Controllers/AccountsController.cs b/src/Api/Auth/Controllers/AccountsController.cs index 700559667d..ea07b0ebfb 100644 --- a/src/Api/Auth/Controllers/AccountsController.cs +++ b/src/Api/Auth/Controllers/AccountsController.cs @@ -19,6 +19,7 @@ using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.KeyManagement.Commands.Interfaces; using Bit.Core.KeyManagement.Kdf; +using Bit.Core.KeyManagement.Models.Data; using Bit.Core.KeyManagement.Queries.Interfaces; using Bit.Core.Models.Api.Response; using Bit.Core.Repositories; @@ -447,13 +448,20 @@ public class AccountsController : Controller if (model.AccountKeys != null) { await _setAccountKeysForUserCommand.SetAccountKeysForUserAsync(user, model.AccountKeys); + return new KeysResponseModel(model.AccountKeys?.ToAccountKeysData(), user.Key); } else { await _userService.SaveUserAsync(model.ToUser(user)); + return new KeysResponseModel(new UserAccountKeysData + { + PublicKeyEncryptionKeyPairData = new PublicKeyEncryptionKeyPairData( + user.PrivateKey, + user.PublicKey + ) + }, user.Key); } - return new KeysResponseModel(model.AccountKeys.ToAccountKeysData(), user.Key); } [HttpGet("keys")]