Добавлен вывод QR яндекса

This commit is contained in:
FrigaT
2026-04-19 21:06:36 +03:00
parent 4324b86512
commit 12241639dc
21 changed files with 1349 additions and 46 deletions

View File

@@ -16,6 +16,7 @@ public class ApplicationDbContext : IdentityDbContext<ApplicationUser, IdentityR
public DbSet<TrackAdditionLog> TrackAdditionLogs => Set<TrackAdditionLog>();
public DbSet<TrackRemovalLog> TrackRemovalLogs => Set<TrackRemovalLog>();
public DbSet<UserSession> UserSessions => Set<UserSession>();
public DbSet<YandexAuthSession> YandexAuthSessions => Set<YandexAuthSession>();
public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
@@ -102,5 +103,36 @@ public class ApplicationDbContext : IdentityDbContext<ApplicationUser, IdentityR
.OnDelete(DeleteBehavior.Cascade);
entity.Property(e => e.AddedAtUtc).IsRequired();
});
builder.Entity<YandexAuthSession>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id)
.ValueGeneratedOnAdd();
entity.HasOne(e => e.User)
.WithMany()
.HasForeignKey(e => e.UserId)
.OnDelete(DeleteBehavior.SetNull);
entity.Property(e => e.QrCodeUrl)
.IsRequired()
.HasMaxLength(500);
entity.Property(e => e.SerializedCookies)
.IsRequired()
.HasColumnType("nvarchar(max)");
entity.Property(e => e.ConfirmedAt)
.IsRequired(false);
entity.Property(e => e.IsConfirmed)
.IsRequired()
.HasDefaultValue(false);
entity.Property(e => e.TrackId)
.HasMaxLength(100)
.IsRequired(false);
entity.Property(e => e.CsfrToken)
.HasMaxLength(200)
.IsRequired(false);
entity.HasIndex(e => e.UserId)
.HasDatabaseName("IX_YandexAuthSessions_UserId");
});
}
}