Files
ERP_Auth_Service/Models/Recovery.cs
T
Dhananjaya99 de7b40a147 ini
2026-07-08 11:11:50 +05:30

33 lines
1021 B
C#

namespace AuthHex.Models
{
public class Recovery
{
public Guid Id { get; set; }
public Guid? UserId { get; set; }
public User? User { get; set; }
public string? RecoveryReferenceNum { get; set; }
// For OTP-based recovery
public string? OTP { get; set; }
public string? OTPReferenceNum { get; set; }
// For Token-based reset (SECURE - hashed)
public string? ResetTokenHash { get; set; }
public string? ResetToken { get; set; } // Plain token (only for email, not saved)
public string Status { get; set; } = "Pending"; // Pending, Used, Expired
public bool IsUsed { get; set; } = false; // Prevent token reuse
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime ExpirationTime { get; set; } = DateTime.UtcNow.AddMinutes(15);
// Recovery type: OTP or ResetLink
public string RecoveryType { get; set; } = "OTP"; // OTP, ResetLink
}
}