PHP Класс FOC\Authenticate\Auth\CookieAuthenticate

Provides the ability to authenticate using COOKIE $this->Auth->config('authenticate', [ 'Authenticate.Cookie' => [ 'fields' => [ 'username' => 'username', 'password' => 'password' ], 'userModel' => 'Users', 'scope' => ['Users.active' => 1], 'crypt' => 'aes', 'cookie' => [ 'name' => 'RememberMe', 'time' => '+2 weeks', ] ] ]); Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Наследование: extends Cake\Auth\BaseAuthenticate
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Cake\Controller\ComponentRegistry $registry, array $config ) Constructor
authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean Authenticate user
getUser ( Cake\Network\Request $request ) : mixed Authenticates the identity contained in the cookie. Will use the userModel config, and fields config to find COOKIE data that is used to find a matching record in the model specified by userModel. Will return false if there is no cookie data, either username or password is missing, or if the scope conditions have not been met.
logout ( Cake\Event\Event $event, array $user ) : void Called from AuthComponent::logout()

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Cake\Controller\ComponentRegistry $registry, array $config )
$registry Cake\Controller\ComponentRegistry The Component registry used on this request.
$config array Array of config to use.

authenticate() публичный Метод

Authenticate user
public authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean
$request Cake\Network\Request Request object.
$response Cake\Network\Response Response object.
Результат array | boolean Array of user info on success, false on falure.

getUser() публичный Метод

Authenticates the identity contained in the cookie. Will use the userModel config, and fields config to find COOKIE data that is used to find a matching record in the model specified by userModel. Will return false if there is no cookie data, either username or password is missing, or if the scope conditions have not been met.
public getUser ( Cake\Network\Request $request ) : mixed
$request Cake\Network\Request The unused request object.
Результат mixed False on login failure. An array of User data on success.

logout() публичный Метод

Called from AuthComponent::logout()
public logout ( Cake\Event\Event $event, array $user ) : void
$event Cake\Event\Event The dispatched Auth.logout event.
$user array User record.
Результат void