Skip to content

Commit

Permalink
♻️ Remove unnecessary code and
Browse files Browse the repository at this point in the history
  • Loading branch information
teramako committed Dec 5, 2024
1 parent 4891d62 commit a548e6f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Jagabata/Cmdlets/UserCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Jagabata.Cmdlets.Utilities;
using Jagabata.Resources;
using System.Management.Automation;
using System.Runtime.InteropServices;
using System.Security;

namespace Jagabata.Cmdlets
Expand Down Expand Up @@ -327,7 +326,6 @@ public class UpdateUserCommand : UpdateCommandBase<User>
protected override Dictionary<string, object?> CreateSendData()
{
var sendData = new Dictionary<string, object?>();
string dataDescription = string.Empty;
if (!string.IsNullOrEmpty(UserName))
sendData.Add("username", UserName);
if (FirstName is not null)
Expand All @@ -342,14 +340,7 @@ public class UpdateUserCommand : UpdateCommandBase<User>
sendData.Add("is_system_auditor", IsSystemAuditor);
if (Password is not null)
{
var passwordString = Marshal.PtrToStringUni(Marshal.SecureStringToGlobalAllocUnicode(Password));
Password.Dispose();
if (!string.IsNullOrEmpty(passwordString))
{
sendData.Add("password", "***"); // dummy
dataDescription = Json.Stringify(sendData, pretty: true);
sendData["password"] = passwordString;
}
sendData.Add("password", Password);
}

return sendData;
Expand Down

0 comments on commit a548e6f

Please sign in to comment.