"Our hub motor is not recommend for bike with front shock forks or bike with front aluminum fork. Please click here to view the dimension of the fork requirement that must fit a 26" rim. Shock fork can flex too much and aluminum fork is generally not strong enough to handle the hub motor torque - breakage can occur" Warning
found here also
here
I have no technical expertise on the subject but I would not think a front shock would be designed to handle the force put on it by a hub motor. I'd be worried about it snapping the shock eventually depending on it's design or at least wearing it excessively.
I used to have a front suspension fork on my bike. It is nice if you don't have alot of hills. I had alot of climbing and I couldn't lock it out so it sucked. I didn't enjoy pogoing up a hill.
Edit: A number of electric scooters have hub motors and use shocks both on the front but I don't know if they design the suspension with that in mind, i'd hope so if it were neccessary.