Fix infinite recursion in setup_credentials