private void CheckIfUserExists(ResetCodeRepresentation resetCode) { var user = _userAuthenticationDataRepository.FindUserAuthByEmail(resetCode.Email); if (user == null) { throw new InvalidCommandException( $"Cannot find user with email: {resetCode.Email} and with reset code {resetCode.ResetCode.Value}"); } }
private UserAuthenticationData FindUserAuthenticationData(RequestResetPasswordCommand request) { var userAuthData = _userAuthenticationDataRepository.FindUserAuthByEmail(request.Email); if (userAuthData == null) { throw new InvalidCommandException($"Cannot find user with email: {request.Email}"); } return(userAuthData); }
private UserAuthenticationData FindUserAuthenticationData(ResetCodeRepresentation resetCode, ResetPasswordCommand request) { var user = _userAuthenticationDataRepository.FindUserAuthByEmail(resetCode.Email); if (user == null) { throw new InvalidCommandException($"Cannot find user with email {resetCode.Email} and with reset code {request.ResetCode.Value}"); } return(user); }