add hashed key to log

This commit is contained in:
Stanley Dimant 2024-08-11 15:06:33 +02:00
parent 30f003828e
commit a159a2ac71
2 changed files with 8 additions and 4 deletions

View file

@ -59,9 +59,10 @@ public partial class MareWizardModule
}
computedHash = StringUtils.Sha256String(StringUtils.GenerateRandomString(64) + DateTime.UtcNow.ToString());
string hashedKey = StringUtils.Sha256String(computedHash);
auth = new Auth()
{
HashedKey = StringUtils.Sha256String(computedHash),
HashedKey = hashedKey,
User = previousAuth.User,
PrimaryUserUID = previousAuth.PrimaryUserUID
};
@ -77,5 +78,7 @@ public partial class MareWizardModule
await db.Auth.AddAsync(auth).ConfigureAwait(false);
await db.SaveChangesAsync().ConfigureAwait(false);
_botServices.Logger.LogInformation("User recovered: {userUID}:{hashedKey}", previousAuth.UserUID, hashedKey);
}
}