You are here

protected function SettingsTrait::isAdminDisabled in Social Auth 3.x

Same name and namespace in other branches
  1. 8.2 src/SettingsTrait.php \Drupal\social_auth\SettingsTrait::isAdminDisabled()

Checks if Admin (user 1) can login.

Parameters

\Drupal\user\UserInterface $drupal_user: User object to check if user is admin.

Return value

bool True if user 1 can't login. False otherwise

1 call to SettingsTrait::isAdminDisabled()
UserAuthenticator::authenticateExistingUser in src/User/UserAuthenticator.php
Authenticates and redirects existing users in authentication process.

File

src/SettingsTrait.php, line 70

Class

SettingsTrait
Helper methods for Social Auth and Drupal settings.

Namespace

Drupal\social_auth

Code

protected function isAdminDisabled(UserInterface $drupal_user) {
  return $this->configFactory
    ->get('social_auth.settings')
    ->get('disable_admin_login') && $drupal_user
    ->id() == 1;
}