1
0
mirror of https://github.com/bitwarden/server synced 2026-02-12 06:23:28 +00:00

feat(register): [PM-27084] Account Register Uses New Data Types - Fixed up reference to master password hash

This commit is contained in:
Patrick Pimentel
2025-12-09 17:08:54 -05:00
parent 6c7daa6343
commit 1535fa35d3
2 changed files with 35 additions and 13 deletions

View File

@@ -25,9 +25,9 @@ public class RegisterFinishRequestModel : IValidatableObject
public MasterPasswordAuthenticationData? MasterPasswordAuthenticationData { get; set; }
public MasterPasswordUnlockData? MasterPasswordUnlockData { get; set; }
// PM-28143 - Made to be optional as migrating to MasterPasswordUnlockData
// PM-28143 - Remove line below (made optional during migration to MasterPasswordUnlockData
[StringLength(1000)]
public required string? MasterPasswordHash { get; set; }
public string? MasterPasswordHash { get; set; }
[StringLength(50)]
public string? MasterPasswordHint { get; set; }
@@ -62,8 +62,8 @@ public class RegisterFinishRequestModel : IValidatableObject
{
Email = Email,
MasterPasswordHint = MasterPasswordHint,
Kdf = MasterPasswordUnlockData?.Kdf.KdfType ?? Kdf ?? throw new Exception($"{nameof(Kdf)} is required"),
KdfIterations = MasterPasswordUnlockData?.Kdf.Iterations ?? KdfIterations ?? throw new Exception($"{nameof(KdfIterations)} is required"),
Kdf = MasterPasswordUnlockData?.Kdf.KdfType ?? Kdf ?? throw new Exception("KdfType couldn't be found on either the MasterPasswordUnlockData or the Kdf property passed in."),
KdfIterations = MasterPasswordUnlockData?.Kdf.Iterations ?? KdfIterations ?? throw new Exception("KdfIterations couldn't be found on either the MasterPasswordUnlockData or the KdfIterations property passed in."),
KdfMemory = MasterPasswordUnlockData?.Kdf.Memory ?? KdfMemory,
KdfParallelism = MasterPasswordUnlockData?.Kdf.Parallelism ?? KdfParallelism,
// PM-28827 To be added when MasterPasswordSalt is added to the user column