Fix mismatch between user/targetedUser in force verify endpoint

This commit is contained in:
sudokoko 2024-05-31 18:40:39 -04:00
parent 3546f60f4f
commit e89a4c27fa
No known key found for this signature in database
GPG key ID: 248D68C664937395

View file

@ -103,7 +103,7 @@ public class AdminUserController : ControllerBase
UserEntity? targetedUser = await this.database.Users.FirstOrDefaultAsync(u => u.UserId == id);
if (targetedUser == null) return this.NotFound();
if (user.EmailAddress == null || user.EmailAddressVerified) return this.NotFound();
if (targetedUser.EmailAddress == null || targetedUser.EmailAddressVerified) return this.NotFound();
List<EmailVerificationTokenEntity> tokens = await this.database.EmailVerificationTokens
.Where(t => t.UserId == targetedUser.UserId)