In contrast with the inflaton case, the curvature perturbations due to the curvaton field depend strongly on the evolution of the curvaton before its decay. We study in detail the dynamics of the curvaton evolution during and after inflation. We consider that the flatness of the curvaton potential may be affected by supergravity corrections, which introduce an effective mass proportional to the Hubble parameter. We also consider that the curvaton potential may be dominated by a quartic or by a non-renormalizable term. We find analytic solutions for the curvaton evolution for all these possibilities. In particular, we show that, in all the above cases, the curvaton density ratio with respect to the background density of the Universe decreases. Therefore, it is necessary that the curvaton decays only after its potential becomes dominated by the quadratic term, which results in (Hubble damped) sinusoidal oscillations. In the case when a non-renormalizable term dominates the potential, we find a possible non-oscillatory attractor solution that threatens to erase the curvature perturbation spectrum. Finally, we study the effects of thermal corrections to the curvaton potential and show that, if they ever dominate the effective mass, they lead to premature thermalization of the curvaton condensate. To avoid this danger, a stringent bound has to be imposed on the coupling of the curvaton to the thermal bath.