mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Fix password re-prompt not working in org view (#1296)
* Fix password reprompt not working in org view * Also fix Cipher_UpdateWithCollections and CipherDetails_CreateWithCollections. Rename migration script
This commit is contained in:
@ -60,7 +60,6 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
existingCipher.FolderId = string.IsNullOrWhiteSpace(FolderId) ? null : (Guid?)new Guid(FolderId);
|
||||
existingCipher.Favorite = Favorite;
|
||||
existingCipher.Reprompt = Reprompt;
|
||||
ToCipher(existingCipher);
|
||||
return existingCipher;
|
||||
}
|
||||
@ -91,6 +90,8 @@ namespace Bit.Core.Models.Api
|
||||
throw new ArgumentException("Unsupported type: " + nameof(Type) + ".");
|
||||
}
|
||||
|
||||
existingCipher.Reprompt = Reprompt;
|
||||
|
||||
var hasAttachments2 = (Attachments2?.Count ?? 0) > 0;
|
||||
var hasAttachments = (Attachments?.Count ?? 0) > 0;
|
||||
|
||||
|
@ -63,6 +63,7 @@ namespace Bit.Core.Models.Api
|
||||
Attachments = AttachmentResponseModel.FromCipher(cipher, globalSettings);
|
||||
OrganizationUseTotp = orgUseTotp;
|
||||
DeletedDate = cipher.DeletedDate;
|
||||
Reprompt = cipher.Reprompt.GetValueOrDefault(CipherRepromptType.None);
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@ -81,6 +82,7 @@ namespace Bit.Core.Models.Api
|
||||
public bool OrganizationUseTotp { get; set; }
|
||||
public DateTime RevisionDate { get; set; }
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
}
|
||||
|
||||
public class CipherResponseModel : CipherMiniResponseModel
|
||||
@ -92,14 +94,12 @@ namespace Bit.Core.Models.Api
|
||||
Favorite = cipher.Favorite;
|
||||
Edit = cipher.Edit;
|
||||
ViewPassword = cipher.ViewPassword;
|
||||
Reprompt = cipher.Reprompt.GetValueOrDefault(CipherRepromptType.None);
|
||||
}
|
||||
|
||||
public string FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
}
|
||||
|
||||
public class CipherDetailsResponseModel : CipherResponseModel
|
||||
|
@ -668,6 +668,8 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
ciphersTable.Columns.Add(revisionDateColumn);
|
||||
var deletedDateColumn = new DataColumn(nameof(c.DeletedDate), typeof(DateTime));
|
||||
ciphersTable.Columns.Add(deletedDateColumn);
|
||||
var repromptColumn = new DataColumn(nameof(c.Reprompt), typeof(short));
|
||||
ciphersTable.Columns.Add(repromptColumn);
|
||||
|
||||
foreach (DataColumn col in ciphersTable.Columns)
|
||||
{
|
||||
@ -693,6 +695,7 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
row[creationDateColumn] = cipher.CreationDate;
|
||||
row[revisionDateColumn] = cipher.RevisionDate;
|
||||
row[deletedDateColumn] = cipher.DeletedDate.HasValue ? (object)cipher.DeletedDate : DBNull.Value;
|
||||
row[repromptColumn] = cipher.Reprompt;
|
||||
|
||||
ciphersTable.Rows.Add(row);
|
||||
}
|
||||
|
Reference in New Issue
Block a user