mirror of
https://github.com/bitwarden/server.git
synced 2025-07-06 18:42:49 -05:00
updates for license validation
This commit is contained in:
@ -65,6 +65,28 @@ namespace Bit.Core.Models.Business
|
||||
return Encoding.UTF8.GetBytes(data);
|
||||
}
|
||||
|
||||
public bool CanUse(User user)
|
||||
{
|
||||
if(Issued > DateTime.UtcNow)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(Expires < DateTime.UtcNow)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(Version == 1)
|
||||
{
|
||||
return user.Email.Equals(Email, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException($"Version {Version} is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
public bool VerifyData(User user)
|
||||
{
|
||||
if(Issued > DateTime.UtcNow)
|
||||
|
Reference in New Issue
Block a user