Browse Source

Added removing of transfer types for passwords when resetting a user's password.

master
Teknikode 3 years ago
parent
commit
39372e6d84
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      Teknik/Areas/User/Utility/UserHelper.cs

+ 11
- 0
Teknik/Areas/User/Utility/UserHelper.cs View File

@@ -422,6 +422,17 @@ namespace Teknik.Areas.Users.Utility
{
// Update User password
user.HashedPassword = SHA384.Hash(user.Username.ToLower(), password).ToHex();

// Remove any password transfer items for the account
for (int i = 0; i < user.Transfers.Count; i++)
{
TransferType type = user.Transfers.ToList()[i];
if (type.Type == TransferTypes.ASCIIPassword || type.Type == TransferTypes.CaseSensitivePassword || type.Type == TransferTypes.Sha256Password)
{
user.Transfers.Remove(type);
i--;
}
}
}
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();

Loading…
Cancel
Save