Added UserExtensions

This commit is contained in:
2025-02-23 12:28:49 -05:00
parent cf9abbe494
commit 2b29be9882
4 changed files with 44 additions and 5 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);
}
}
}