22 lines
712 B
C#
22 lines
712 B
C#
|
using System;
|
|||
|
using Portoa.Logging;
|
|||
|
using Portoa.Persistence;
|
|||
|
using Portoa.Security;
|
|||
|
|
|||
|
namespace VideoGameQuotes.Api {
|
|||
|
public class User : Entity<User, int>, IPasswordProtected {
|
|||
|
private readonly IPasswordProtected passwordProtector = new NullAllowingPasswordProtector();
|
|||
|
|
|||
|
public virtual DateTime Created { get; set; }
|
|||
|
public virtual string Username { get; set; }
|
|||
|
public virtual UserGroup Group { get; set; }
|
|||
|
|
|||
|
public virtual void ChangePassword([DoNotLog]string newPassword) {
|
|||
|
passwordProtector.ChangePassword(newPassword);
|
|||
|
}
|
|||
|
|
|||
|
public virtual bool VerifyPassword([DoNotLog]string potentialPassword) {
|
|||
|
return passwordProtector.VerifyPassword(potentialPassword);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|