Direct detection of dark photon dark matter with the James Webb Space Telescope