Adding structure to responses
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
@@ -10,17 +9,13 @@ namespace TextSender_API.Controllers;
|
||||
public class PasswordVerification
|
||||
{
|
||||
#region Fiends
|
||||
private UsersRepository? _userRepo;
|
||||
private SaltRepository? _saltRepo;
|
||||
private UsersRepository _userRepo;
|
||||
private SaltRepository _saltRepo;
|
||||
private int _keySize = 64;
|
||||
private int _iterations = 350000;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public PasswordVerification()
|
||||
{
|
||||
}
|
||||
|
||||
public PasswordVerification(UsersRepository userRepo, SaltRepository saltRepo)
|
||||
{
|
||||
this._userRepo = userRepo;
|
||||
@@ -31,7 +26,7 @@ public class PasswordVerification
|
||||
#region Methods
|
||||
public bool VerifyPassword(User user, string password)
|
||||
{
|
||||
var salt = this._saltRepo.Retrieve(user.Id);
|
||||
var salt = this._saltRepo.Retrieve(user.Id!);
|
||||
var hashedPassword = this.HashPassword(user, salt, password);
|
||||
|
||||
return hashedPassword.Equals(user.Password);
|
||||
|
||||
Reference in New Issue
Block a user