Make HashHelper.Sha256Hash lowercase by default, fix ResetPasswordCommand

This commit is contained in:
jvyden 2021-11-23 18:29:07 -05:00
commit cc2be73bb0
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 3 additions and 1 deletions

View file

@ -39,6 +39,8 @@ namespace LBPUnion.ProjectLighthouse.CommandLine
user.Password = HashHelper.BCryptHash(password);
await this.database.SaveChangesAsync();
Console.WriteLine($"The password for user {user.Username} (id: {user.UserId}) has been reset.");
}
}

View file

@ -67,7 +67,7 @@ namespace LBPUnion.ProjectLighthouse.Helpers
public static string Sha256Hash(string str) => Sha256Hash(Encoding.UTF8.GetBytes(str));
public static string Sha256Hash(byte[] bytes) => BitConverter.ToString(sha256.ComputeHash(bytes)).Replace("-", "");
public static string Sha256Hash(byte[] bytes) => BitConverter.ToString(sha256.ComputeHash(bytes)).Replace("-", "").ToLower();
public static string Sha1Hash(string str) => Sha1Hash(Encoding.UTF8.GetBytes(str));