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