Let $(M,g)$ be a geodesically-complete Riemannian manifold. It is well-known that every harmonic $L^{2}$-function on $M$ is necessarily constant. The way to prove this is to show that every harmonic $L^{2}$-function is both closed and co-closed and every closed function has to be a constant (lets assume $M$ is connected).
My question is the following:
If $f\in C^{\infty}(M)$ be harmonic such that $df$ is $L^{2}$. Does it then also follow that $f$ is constant?
My first approach was
$$\infty>\Vert df\Vert_{L^{2}}^{2}=\langle d f,df\rangle_{L^{2}}=\langle f,\Delta f\rangle_{L^{2}}=0$$
and hence $df=0$. However, I am not sure about the last to last step, since one need somehow a $L^{2}$-version of Stokes theorem.