diff --git a/ProjectLighthouse/CommandLine/ResetPasswordCommand.cs b/ProjectLighthouse/CommandLine/ResetPasswordCommand.cs index be2e5dd5..bfbb46c0 100644 --- a/ProjectLighthouse/CommandLine/ResetPasswordCommand.cs +++ b/ProjectLighthouse/CommandLine/ResetPasswordCommand.cs @@ -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."); } } diff --git a/ProjectLighthouse/Helpers/HashHelper.cs b/ProjectLighthouse/Helpers/HashHelper.cs index 838a22a4..88012439 100644 --- a/ProjectLighthouse/Helpers/HashHelper.cs +++ b/ProjectLighthouse/Helpers/HashHelper.cs @@ -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));