shoc-backend/Data.SeaHavenIndustries/Models/ForgetPasswordCode.cs

35 lines
1 KiB
C#
Raw Normal View History

2024-09-28 14:58:36 -04:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
2024-09-28 14:58:36 -04:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Data.SeaHavenIndustries
{
public class ForgetPasswordCode
{
public int Id { get; set; }
public string UserId { get; set; }
public string Email { get; set; }
/// <summary>
/// Legacy plaintext column. It is always written empty; only
/// <see cref="CodeHash"/> is compared.
/// </summary>
public string Code { get; set; } = string.Empty;
/// <summary>Lowercase hex SHA-256 of "<see cref="CodeSalt"/>:code".</summary>
[MaxLength(64)]
public string CodeHash { get; set; } = string.Empty;
[MaxLength(32)]
public string CodeSalt { get; set; } = string.Empty;
public DateTime ExpiresAtUtc { get; set; }
/// <summary>Checks consumed against this code, including concurrent ones still in flight.</summary>
public int FailedAttempts { get; set; }
2024-09-28 14:58:36 -04:00
}
}