From e932f3a00a65afee6c986cf217b138c663dc034e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 11 Jul 2017 14:43:43 -0400 Subject: [PATCH] fix cipher too many args for sql --- src/Api/Controllers/LoginsController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/Controllers/LoginsController.cs b/src/Api/Controllers/LoginsController.cs index f50013a923..86d22d4765 100644 --- a/src/Api/Controllers/LoginsController.cs +++ b/src/Api/Controllers/LoginsController.cs @@ -138,9 +138,11 @@ namespace Bit.Api.Controllers throw new NotFoundException(); } - await _cipherService.SaveAsync(model.ToCipher(login), userId, true); + // object cannot be a descendant of CipherDetails, so let's clone it. + var cipher = Core.Utilities.CoreHelpers.CloneObject(model.ToCipher(login)); + await _cipherService.SaveAsync(cipher, userId, true); - var response = new LoginResponseModel(login, _globalSettings, login.OrganizationUseTotp); + var response = new LoginResponseModel(cipher, _globalSettings, login.OrganizationUseTotp); return response; }