OneTime Invites Server handling (#17)

* add server-side handling for one time invites
This commit is contained in:
rootdarkarchon
2022-10-25 00:54:51 +02:00
committed by GitHub
parent c13e457780
commit d83d9a6753
10 changed files with 1206 additions and 2 deletions

View File

@@ -109,6 +109,16 @@ public class CleanupService : IHostedService, IDisposable
_logger.LogWarning(ex, "Error during user purge");
}
try
{
var tempInvites = await dbContext.GroupTempInvites.ToListAsync();
dbContext.RemoveRange(tempInvites.Where(i => i.ExpirationDate < DateTime.UtcNow));
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Error during Temp Invite purge");
}
_authService.ClearUnauthorizedUsers();
_logger.LogInformation($"Cleanup complete");