fix(auth): secure 2FA challenges and session revocation

This commit is contained in:
Arnaud Dartois committed 2026-10-20 07:21:28 +02:00
1 parent 21f0530b6c
commit 26321bb81c
43 files changed
+6533 -213

No files matched your search

@@ -0,0 +1,18 @@
using Heimdall.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Heimdall.Infrastructure.Data.Configurations;
public class LoginChallengeConfiguration : IEntityTypeConfiguration<LoginChallenge>
{
public void Configure(EntityTypeBuilder<LoginChallenge> builder)
{
builder.ToTable("login_challenges");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).HasMaxLength(64);
builder.Property(x => x.SecurityStamp).HasMaxLength(256);
builder.HasIndex(x => x.ExpiresAt);
builder.HasOne<AppUser>().WithMany().HasForeignKey(x => x.UserId).OnDelete(DeleteBehavior.Cascade);
}
}