Complete reset password function.