User authentication is functional
This commit is contained in:
@@ -47,6 +47,7 @@ public class PasswordVerification
|
|||||||
public string HashPassword(User user, Salt salt, string password = "")
|
public string HashPassword(User user, Salt salt, string password = "")
|
||||||
{
|
{
|
||||||
var hashAlgorithm = HashAlgorithmName.SHA512;
|
var hashAlgorithm = HashAlgorithmName.SHA512;
|
||||||
|
var dbHashedPassword = user.Password;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(password))
|
if (!string.IsNullOrEmpty(password))
|
||||||
{
|
{
|
||||||
@@ -60,6 +61,8 @@ public class PasswordVerification
|
|||||||
hashAlgorithm,
|
hashAlgorithm,
|
||||||
this._keySize);
|
this._keySize);
|
||||||
|
|
||||||
|
user.Password = dbHashedPassword;
|
||||||
|
|
||||||
return Convert.ToHexString(hash);
|
return Convert.ToHexString(hash);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ using TextSender_API.Repositories;
|
|||||||
public class BaseRepository
|
public class BaseRepository
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
protected string _connectionString;
|
protected string? _connectionString;
|
||||||
protected string _databaseName = "textSender";
|
protected string _databaseName = "textSender";
|
||||||
protected string _tableName;
|
protected string? _tableName;
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user