Skip to content

Commit

Permalink
ZWOO-409 fix: actually clean up password resets
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankachlock committed Nov 15, 2023
1 parent 8774dc5 commit da06f3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/ZwooDatabase/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ public void CleanUpUsers()
}

var usersWithPasswordReset = _db.Users.AsQueryable().Where(x => !String.IsNullOrEmpty(x.PasswordResetCode));
_logger.Info($"[CleanUp] deleted {unverifiedUsers.Count()} password reset codes.");
foreach (var user in unverifiedUsers)
_logger.Info($"[CleanUp] deleted {usersWithPasswordReset.Count()} password reset codes.");
foreach (var user in usersWithPasswordReset)
{
_db.Users.UpdateOne(x => x.Id == user.Id, Builders<UserDao>.Update.Set(u => u.PasswordResetCode, ""));
}
Expand Down

0 comments on commit da06f3f

Please sign in to comment.