Skip to content

Commit

Permalink
Fix mismatch between user/targetedUser in force verify endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sudokoko committed May 31, 2024
1 parent 3546f60 commit e89a4c2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public async Task<IActionResult> ForceVerifyEmail([FromRoute] int id)

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)
Expand Down

0 comments on commit e89a4c2

Please sign in to comment.