This commit is contained in:
Dhananjaya99
2026-07-08 11:11:50 +05:30
parent 2cd2741f77
commit de7b40a147
51 changed files with 6839 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
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
}
}