I have read there are pros and cons with both ways, but LARGELY finishing before gluing in the neck, seems to be the best way, and if you stain/paint before fixing the neck, make sure you leave the glue surface area of the neck joint free of any finish, otherwise the glue won't bond as intended. That's it in a nutshell - others with more finishing experience than me can give more detailed reasoning behind the pros and cons of whether to finish before gluing the neck.
Personally, I'm staining, then finishing in shellac with my build, so I'm going to sand/stain, then glue the neck, and then finish the finish, so to speak, after filling in any gaps in the neck joint area.