Files
SocialPub/PrivaPub/Models/User/EmailVerification.cs
T

18 lines
656 B
C#
Raw Normal View History

using MongoDB.Entities;
namespace PrivaPub.Models.User
{
// An address a login asked for, until the code sent to it comes back. EmailVerificationJob makes the code and keeps its
// hash only; the row expires (a TTL index on ExpiresAt), and five wrong codes take it away.
public class EmailVerification : Entity
{
public const int MaxAttempts = 5;
public static readonly TimeSpan Lifetime = TimeSpan.FromHours(1);
public string RootUserId { get; set; }
public string Email { get; set; }
public string CodeHash { get; set; }//null until the job sent the code
public int Attempts { get; set; }
public DateTime ExpiresAt { get; set; }
}
}