src/preferred-provider.js
function providerExists (uri) {
  let providerOrigin = (new URL(uri)).origin
  let providerConfigUri = providerOrigin + '/.well-known/openid-configuration'

  return fetch(providerConfigUri, { method: 'HEAD' })
    .then(result => {
      if (result.ok) {
        return providerOrigin
      }

      return null
    })
}
function providerExists (uri) {
  let providerOrigin = (new URL(uri)).origin
  let providerConfigUri = providerOrigin + '/.well-known/openid-configuration'

  return fetch(providerConfigUri, { method: 'HEAD' })
    .then(result => {
      if (result.ok) {
        return providerOrigin
      }

      return null
    })
}
@param uri {string} Provider URI or Web ID URI

@returns {Promise<string|null>} Returns the Provider URI origin if an OIDC
provider exists at the given uri, or `null` if none exists