diff --git a/AnalysisData/AnalysisData/Services/TokenService/ValidateTokenService.cs b/AnalysisData/AnalysisData/Services/TokenService/ValidateTokenService.cs index 5dae496..dbbf6e9 100644 --- a/AnalysisData/AnalysisData/Services/TokenService/ValidateTokenService.cs +++ b/AnalysisData/AnalysisData/Services/TokenService/ValidateTokenService.cs @@ -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();