You are here

public function drupalchatController::ex_auth in DrupalChat 8

1 string reference to 'drupalchatController::ex_auth'
drupalchat.routing.yml in ./drupalchat.routing.yml
drupalchat.routing.yml

File

src/Controller/drupalchatController.php, line 1020
Contains Drupal\drupalchat\Controller\drupalchatController

Class

drupalchatController

Namespace

Drupal\drupalchat\Controller

Code

public function ex_auth() {

  // Load the current user.
  $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()
    ->id());
  $user_name = $user
    ->getUsername();
  $uid = $user
    ->get('uid')->value;
  if ($uid) {
    $response = drupalchatController::_drupalchat_get_auth(array());
  }
  return new JsonResponse($response);
}