AS above, both, but if just one then helmet. Bar mount can work well especially with a good wide light but then along comes a jump or a dropoff (or a manual) and all it’s lighting up is the moon. It’s not ideal.
On the other hand, helmet light alone can give you depth pereption issues because the light’s so close to your eyes, you get no useful shadows. Also if it’s rainy or misty or even dusty you get unbelievable glare, with modern superbright lights it’s like having your head in a lightbulb.
(riding with just one light isn’t just not ideal, it also gets a bit fraught if you break a light)