Both sound like
/-dənt/ to me.
confidant comes to English from the French word confident, and when the word first entered our language it was often spelled that way, rather than as confidant.
So they were actually the same word. Do we really need to tell a difference between them?