mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Improved code readability
This commit is contained in:
parent
f5c771a057
commit
bc7546ddaa
@ -82,11 +82,9 @@ public class PayPalIPNTransactionModel
|
||||
IsAccountCredit = custom.Contains("account_credit:1");
|
||||
}
|
||||
|
||||
private static string Extract(IReadOnlyDictionary<string, string> data, string key)
|
||||
{
|
||||
var success = data.TryGetValue(key, out var value);
|
||||
return success ? value : null;
|
||||
}
|
||||
private static string Extract(IReadOnlyDictionary<string, string> data, string key) =>
|
||||
data.TryGetValue(key, out var value) ? value : null;
|
||||
|
||||
|
||||
private static DateTime ToUTCDateTime(string input)
|
||||
{
|
||||
|
@ -32,7 +32,6 @@ namespace Bit.Identity.Controllers;
|
||||
public class AccountsController : Controller
|
||||
{
|
||||
private readonly ICurrentContext _currentContext;
|
||||
private readonly ILogger<AccountsController> _logger;
|
||||
private readonly IUserRepository _userRepository;
|
||||
private readonly IRegisterUserCommand _registerUserCommand;
|
||||
private readonly ICaptchaValidationService _captchaValidationService;
|
||||
@ -45,7 +44,6 @@ public class AccountsController : Controller
|
||||
|
||||
public AccountsController(
|
||||
ICurrentContext currentContext,
|
||||
ILogger<AccountsController> logger,
|
||||
IUserRepository userRepository,
|
||||
IRegisterUserCommand registerUserCommand,
|
||||
ICaptchaValidationService captchaValidationService,
|
||||
@ -58,7 +56,6 @@ public class AccountsController : Controller
|
||||
)
|
||||
{
|
||||
_currentContext = currentContext;
|
||||
_logger = logger;
|
||||
_userRepository = userRepository;
|
||||
_registerUserCommand = registerUserCommand;
|
||||
_captchaValidationService = captchaValidationService;
|
||||
|
@ -41,25 +41,13 @@ public class RegisterRequestModel : IValidatableObject, ICaptchaProtectedModel
|
||||
Email = Email,
|
||||
MasterPasswordHint = MasterPasswordHint,
|
||||
Kdf = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
|
||||
KdfIterations = KdfIterations.GetValueOrDefault(AuthConstants.PBKDF2_ITERATIONS.Default),
|
||||
KdfIterations = KdfIterations ?? AuthConstants.PBKDF2_ITERATIONS.Default,
|
||||
KdfMemory = KdfMemory,
|
||||
KdfParallelism = KdfParallelism
|
||||
KdfParallelism = KdfParallelism,
|
||||
ReferenceData = ReferenceData != null ? JsonSerializer.Serialize(ReferenceData) : null,
|
||||
Key = Key
|
||||
};
|
||||
|
||||
if (ReferenceData != null)
|
||||
{
|
||||
user.ReferenceData = JsonSerializer.Serialize(ReferenceData);
|
||||
}
|
||||
|
||||
if (Key != null)
|
||||
{
|
||||
user.Key = Key;
|
||||
}
|
||||
|
||||
if (Keys != null)
|
||||
{
|
||||
Keys.ToUser(user);
|
||||
}
|
||||
Keys?.ToUser(user);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user