Closed eelkeblok closed 4 years ago
Oh, good catch. The dependency doesn't have to be explicitly set because the IndieAuth module allows for external authentication to (meaning, not using the internal indieauth endpoint). The block should check whether the service exists or not and show a warning.
I would suggest the configuration screen is also a good place to make the user aware of this. In fact, I think the block could simply state that authentication is not enabled (as it does now) and then in the configuration screen show a warning that the externelauth module needs to be enabled.
Actually the code does try to cater for the service not existing by checking the value of the variable. Unfortunately, Drupal::service throws an exception for non-existing services. Having a crack at fixing this.
\Drupal::hasService() should work I think
committed to drupal.org as well see https://git.drupalcode.org/project/indieweb/commit/8db5799686dfa6b895676e5f855e426976e540e8
Looks like drupal.org misses the attribution though :/ I hope the pull request stuff starts working soon on d.o so I can move it over there ..
Crap it broke a test :) see https://www.drupal.org/pift-ci-job/1531894 Will have to figure out what's causing it.
Ok, easy fix, it actually forgot to return TRUE if an external account was found :)
Oh no, that was silly :) No worries about the attribution, and I'm with you hoping for PRs on d.o. I'm doing an internal talk about the patch workflow soon, so maybe I can "jinx" it that way, have my talk rendered obsolete :)
The auth module makes use of functionality in the externalauth module, but it does not list it as a dependency, which means an exception will be thrown when the authentication block is added to a site.