You are here

UsernamePassword.php in DRD Agent 8.3

Same filename and directory in other branches
  1. 4.0.x src/Agent/Auth/UsernamePassword.php

File

src/Agent/Auth/UsernamePassword.php
View source
<?php

namespace Drupal\drd_agent\Agent\Auth;


/**
 * Implements the UsernamePassword authentication method.
 */
class UsernamePassword extends Base {

  /**
   * {@inheritdoc}
   */
  public function validate(array $settings) : bool {
    if ($this->currentUser
      ->isAuthenticated()) {
      return TRUE;
    }
    return $this->userAuth
      ->authenticate($settings['username'], $settings['password']);
  }

}

Classes

Namesort descending Description
UsernamePassword Implements the UsernamePassword authentication method.