Only prompt for credentials when the transport fails.

Closes issue 21.