Add user extensions and encryption modules.

This commit is contained in:
2025-04-06 18:21:49 -04:00
parent 6cf0ba1c5a
commit 954c45ee81
3 changed files with 78 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
using MarketData.MarketDataModel.User;
using MarketData.Security;
namespace MarketData.Extensions
{
public static class UserExtensions
{
public static bool Verify(this User user, string password)
{
if(null == user || null == user.Username || null == user.Salt || null==user.Hash)
{
return false;
}
return Encryption.VerifyPassword(password, user.Salt, user.Hash);
}
}
}