reverted: --- b/src/Form/SocialAuthSettingsForm.php +++ a/src/Form/SocialAuthSettingsForm.php @@ -78,7 +78,7 @@ '#default_value' => $social_auth_config->get('disabled_roles'), ); if (empty($roles)) { + $form['social_auth']['disabled_roles']['#description'] = t('No roles found.'); - $form['social_auth']['disabled_roles']['#description'] = $this->t('No roles found.'); } return parent::buildForm($form, $form_state); diff -u b/src/SocialAuthUserManager.php b/src/SocialAuthUserManager.php --- b/src/SocialAuthUserManager.php +++ b/src/SocialAuthUserManager.php @@ -66,15 +66,15 @@ * Used for user picture directory and file transliteration. */ public function __construct(ConfigFactoryInterface $config_factory, LoggerChannelFactoryInterface $logger_factory, EventDispatcherInterface $event_dispatcher, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, Token $token, TranslationInterface $string_translation, PhpTransliteration $transliteration, LanguageManagerInterface $language_manager) { - $this->configFactory = $config_factory; - $this->loggerFactory = $logger_factory; - $this->eventDispatcher = $event_dispatcher; - $this->entityTypeManager = $entity_type_manager; + $this->configFactory = $config_factory; + $this->loggerFactory = $logger_factory; + $this->eventDispatcher = $event_dispatcher; + $this->entityTypeManager = $entity_type_manager; $this->entityFieldManager = $entity_field_manager; - $this->token = $token; - $this->stringTranslation = $string_translation; - $this->transliteration = $transliteration; - $this->languageManager = $language_manager; + $this->token = $token; + $this->stringTranslation = $string_translation; + $this->transliteration = $transliteration; + $this->languageManager = $language_manager; // Sets default plugin id. $this->setPluginId('social_auth'); @@ -104,6 +104,10 @@ if ($this->loginUser($drupal_user)) { return $this->redirect('user.page'); } + else { + drupal_set_message($this->t("Your account has not been approved yet or might have been canceled, please contact the administrator"), 'error'); + return $this->redirect('user.login'); + } } $drupal_user = $this->createUser($name, $email); @@ -131,7 +135,7 @@ /** * Sets the implementer plugin id. * - * This value is used to generate customized logs, drupal messages, and events + * This value is used to generate customized logs, drupal messages, and event * dispatchers. * * @param string $plugin_id