mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace RadicadeServer.Admin;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class AdminUser
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required, MaxLength(64)]
|
||||
public string Username { get; set; } = "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[Required]
|
||||
public string PasswordHash { get; set; } = "";
|
||||
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? TotpSecret { get; set; }
|
||||
|
||||
public bool TotpEnabled { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? LastLoginAt { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class AdminSessionRecord
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public long AdminUserId { get; set; }
|
||||
|
||||
|
||||
[Required, MaxLength(64)]
|
||||
public string TokenHash { get; set; } = "";
|
||||
|
||||
|
||||
|
||||
[MaxLength(64)]
|
||||
public string? PreviousTokenHash { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime LastSeenAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
|
||||
public DateTime? RevokedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user