mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 21:27:22 +01:00
fix not being able to delete discord auth for not finished reg account
This commit is contained in:
parent
b0ec2c5001
commit
2a902ef15f
1 changed files with 9 additions and 4 deletions
|
|
@ -96,11 +96,16 @@ namespace MareSynchronosServer.Discord
|
|||
using var scope = services.CreateScope();
|
||||
using var db = scope.ServiceProvider.GetService<MareDbContext>();
|
||||
var discordAuthedUser = await db.LodeStoneAuth.Include(u => u.User).FirstOrDefaultAsync(u => u.DiscordId == id);
|
||||
if (discordAuthedUser != null && discordAuthedUser.User != null)
|
||||
if (discordAuthedUser != null)
|
||||
{
|
||||
logger.LogInformation("Purging user: " + discordAuthedUser.User.UID);
|
||||
|
||||
FileCleanupService.PurgeUser(discordAuthedUser.User, db, configuration);
|
||||
if (discordAuthedUser.User != null)
|
||||
{
|
||||
FileCleanupService.PurgeUser(discordAuthedUser.User, db, configuration);
|
||||
}
|
||||
else
|
||||
{
|
||||
db.Remove(discordAuthedUser);
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue