mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 21:07:21 +01:00
remove authentication as well when user deletes their account
This commit is contained in:
parent
332e5a04d4
commit
1953de8c38
1 changed files with 3 additions and 1 deletions
|
|
@ -20,11 +20,11 @@ namespace MareSynchronosServer.Hubs
|
|||
{
|
||||
_logger.LogInformation("User " + AuthenticatedUserId + " deleted their account");
|
||||
|
||||
|
||||
string userid = AuthenticatedUserId;
|
||||
var userEntry = await _dbContext.Users.SingleAsync(u => u.UID == userid);
|
||||
var ownPairData = await _dbContext.ClientPairs.Where(u => u.User.UID == userid).ToListAsync();
|
||||
var auth = await _dbContext.Auth.SingleAsync(u => u.UserUID == userid);
|
||||
|
||||
var lodestone = await _dbContext.LodeStoneAuth.SingleOrDefaultAsync(a => a.User.UID == userid);
|
||||
|
||||
if (lodestone != null)
|
||||
|
|
@ -37,6 +37,8 @@ namespace MareSynchronosServer.Hubs
|
|||
await Task.Delay(1000);
|
||||
}
|
||||
|
||||
SecretKeyAuthenticationHandler.RemoveAuthentication(userid);
|
||||
|
||||
MareMetrics.Pairs.Dec(ownPairData.Count);
|
||||
MareMetrics.PairsPaused.Dec(ownPairData.Count(c => c.IsPaused));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue