Multiple changes to HashHelper and RandomHelper

- Renamed HashHelper to CryptoHelper
- Moved CryptoHelper.GenerateRandomBytes to RandomHelper
- Documented RandomHelper
This commit is contained in:
jvyden 2022-05-01 15:27:35 -04:00
parent 396477c05d
commit f31a73ccaa
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
22 changed files with 86 additions and 86 deletions

View file

@ -19,12 +19,12 @@ public class CreateUserCommand : ICommand
string onlineId = args[0];
string password = args[1];
password = HashHelper.Sha256Hash(password);
password = CryptoHelper.Sha256Hash(password);
User? user = await this._database.Users.FirstOrDefaultAsync(u => u.Username == onlineId);
if (user == null)
{
user = await this._database.CreateUser(onlineId, HashHelper.BCryptHash(password));
user = await this._database.CreateUser(onlineId, CryptoHelper.BCryptHash(password));
Logger.Log($"Created user {user.UserId} with online ID (username) {user.Username} and the specified password.", LoggerLevelLogin.Instance);
user.PasswordResetRequired = true;