Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion SS14.Auth.Shared/Config/AccountConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ public sealed class AccountConfiguration
/// Delete unconfirmed accounts after this many days.
/// </summary>
public int DeleteUnconfirmedAfter { get; set; } = 3;
}

/// <summary>
/// How long to wait before deleting a user account.
/// </summary>
public int UserDeletionGracePeriodDays { get; set; } = 30;
}
16 changes: 14 additions & 2 deletions SS14.Auth.Shared/Data/ApplicationDbContext.cs
Comment thread
juliangiebel marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ApplicationDbContext : IdentityDbContext<SpaceUser, SpaceRole, Guid
IConfigurationDbContext,
IPersistedGrantDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
public ApplicationDbContext(DbContextOptions options)
: base(options)
{
}
Expand Down Expand Up @@ -81,8 +81,19 @@ protected override void OnModelCreating(ModelBuilder builder)

builder.Entity<DeletedUser>()
.Property(d => d.DeletedOn)
.HasDefaultValue(DateTime.UtcNow);
.HasDefaultValueSql("now()");
Comment thread
juliangiebel marked this conversation as resolved.
Resolved

builder.Entity<UserDeletionQueueEntry>()
.HasKey(d => d.SpaceUserId);

builder.Entity<UserDeletionQueueEntry>()
.HasOne<SpaceUser>()
.WithOne()
.HasForeignKey<UserDeletionQueueEntry>(d => d.SpaceUserId);

builder.Entity<UserDeletionQueueEntry>()
.Property(d => d.QueuedOn)
.HasDefaultValueSql("now()");

var cfgStoreOptions = new ConfigurationStoreOptions
{
Expand Down Expand Up @@ -130,6 +141,7 @@ protected override void OnModelCreating(ModelBuilder builder)
public DbSet<Hwid> Hwids { get; set; }
public DbSet<HwidUser> HwidUsers { get; set; }

public DbSet<UserDeletionQueueEntry> UserDeletionQueue { get; set; }
public DbSet<DeletedUser> DeletedUserIds { get; set; }

// IS4 configuration.
Expand Down
1 change: 1 addition & 0 deletions SS14.Auth.Shared/Data/DeletedUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ public sealed class DeletedUser
{
public Guid SpaceUserId { get; set; }
public DateTime DeletedOn { get; set; }
public bool DeletionPropagated { get; set; }
}
Loading
Loading