Skip to content

Commit

Permalink
fix(email recovery) : fix email recovery (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdijafariii authored Sep 9, 2024
1 parent 2d49167 commit 32b1ec0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public ValidateTokenService(IPasswordResetTokensRepository resetTokensRepository
public async Task ValidateResetToken(Guid userId, string resetPasswordToken)
{
var resetToken = await _resetTokensRepository.GetToken(userId,resetPasswordToken);
if (resetToken == null || resetToken.IsUsed)
if (resetToken == null)
throw new TokenIsInvalidException();
if (resetToken.IsUsed)
throw new TokenIsInvalidException();
if (resetToken.Expiration < DateTime.UtcNow)
throw new TokenExpiredException();
Expand Down

0 comments on commit 32b1ec0

Please sign in to comment.