I am reading the chapter on electron-proton scattering from "Quantum Field Theory in a Nutshell". The author calculates the amplitude of the electron-proton scattering (up to the second order). The Feynman diagram used in this calculation is
We start by using the massive spin 1 boson as an exchange, and hope to get rid of the mass later. Let the mass of the boson be $\mu$
Using the Feynman rules, we obtained the amplitude to be
$$\mathcal{M}(P,P_N) = (-ie)(ie)\frac{i}{(P-p)^2-\mu^2}\left(\frac{k_\mu k_\nu}{\mu^2}-\eta_{\mu\nu}\right)\bar{u}(P)\gamma^\mu u(p)\bar{u}(P_N)\gamma^\nu u(p_N).$$
He claims that the term $k_\mu k_\nu$ will just disappear because
$$k_\mu \bar{u}(P)\gamma^\mu u(p) = (P-p)_\mu \bar{u}(P)\gamma^\mu u(p) = \bar{u}(P)(\not P - \not p) u(p)=\bar{u}(P)(m - m) u(p)=0.$$
However, the last equation follows the Dirac equation, which is the equation of motion of the electron. The point that I do not understand is, how can we use the equation of motion in the quantum field theory? Clearly, the equation of motion comes from minimising (extremising) the action, which leads to the classical field rather than quantum field.