From 145eea8e924a81dccf6354f90dc8233726d4b9f1 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 29 Sep 2023 06:44:11 -0400 Subject: [PATCH] User authentication is functional --- Controllers/PasswordVerification.cs | 3 +++ Repositories/BaseRepository.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Controllers/PasswordVerification.cs b/Controllers/PasswordVerification.cs index 4016532..9a09812 100644 --- a/Controllers/PasswordVerification.cs +++ b/Controllers/PasswordVerification.cs @@ -47,6 +47,7 @@ public class PasswordVerification public string HashPassword(User user, Salt salt, string password = "") { var hashAlgorithm = HashAlgorithmName.SHA512; + var dbHashedPassword = user.Password; if (!string.IsNullOrEmpty(password)) { @@ -60,6 +61,8 @@ public class PasswordVerification hashAlgorithm, this._keySize); + user.Password = dbHashedPassword; + return Convert.ToHexString(hash); } #endregion diff --git a/Repositories/BaseRepository.cs b/Repositories/BaseRepository.cs index 4d721fb..1c69eb8 100644 --- a/Repositories/BaseRepository.cs +++ b/Repositories/BaseRepository.cs @@ -4,8 +4,8 @@ using TextSender_API.Repositories; public class BaseRepository { #region Fields - protected string _connectionString; + protected string? _connectionString; protected string _databaseName = "textSender"; - protected string _tableName; + protected string? _tableName; #endregion } \ No newline at end of file