Skip to content

Commit

Permalink
Merge pull request #499 from fabiankachlock/ZWOO-409-missing-pw-reset…
Browse files Browse the repository at this point in the history
…-cleanup

ZWOO-409 fix: actually clean up password resets
  • Loading branch information
fabiankachlock authored Nov 16, 2023
2 parents 80d6269 + da06f3f commit c2c35b5
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 c2c35b5

Please sign in to comment.