18 lines
426 B
C#
18 lines
426 B
C#
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);
|
|
}
|
|
}
|
|
}
|