mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-13 23:24:15 +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 scope = services.CreateScope();
|
||||||
using var db = scope.ServiceProvider.GetService<MareDbContext>();
|
using var db = scope.ServiceProvider.GetService<MareDbContext>();
|
||||||
var discordAuthedUser = await db.LodeStoneAuth.Include(u => u.User).FirstOrDefaultAsync(u => u.DiscordId == id);
|
var discordAuthedUser = await db.LodeStoneAuth.Include(u => u.User).FirstOrDefaultAsync(u => u.DiscordId == id);
|
||||||
if (discordAuthedUser != null && discordAuthedUser.User != null)
|
if (discordAuthedUser != null)
|
||||||
|
{
|
||||||
|
if (discordAuthedUser.User != null)
|
||||||
{
|
{
|
||||||
logger.LogInformation("Purging user: " + discordAuthedUser.User.UID);
|
|
||||||
|
|
||||||
FileCleanupService.PurgeUser(discordAuthedUser.User, db, configuration);
|
FileCleanupService.PurgeUser(discordAuthedUser.User, db, configuration);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
db.Remove(discordAuthedUser);
|
||||||
|
}
|
||||||
|
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue