public function getUser(ServerRequest $request)
    {
        $payload = $this->getPayload($request);

        if (empty($payload)) {
            return false;
        }

        if (!$this->_config['queryDatasource']) {
            return json_decode(json_encode($payload), true);
        }

        if (!isset($payload->sub)) {
            return false;
        }

        $user = $this->_findUser($payload->sub);
        if (!$user) {
            return false;
        }

        unset($user[$this->_config['fields']['password']]);

        return $user;
    }
public function getUser(ServerRequest $request)
    {
        $payload = $this->getPayload($request);

        if (empty($payload)) {
            return false;
        }

        if (!$this->_config['queryDatasource']) {
            return json_decode(json_encode($payload), true);
        }

        if (!isset($payload->sub)) {
            return false;
        }

        $user = $this->_findUser($payload->sub);
        if (!$user) {
            return false;
        }

        unset($user[$this->_config['fields']['password']]);

        return $user;
    }
public function getUser ( ServerRequest $ request ) { $ payload = $ this -> getPayload ( $ request ) ; if ( empty ( $ payload ) ) { return false ; } if ( ! $ this -> _config [ 'queryDatasource' ] ) { return json_decode ( json_encode ( $ payload ) , true ) ; } if ( ! isset ( $ payload -> sub ) ) { return false ; } $ user = $ this -> _findUser ( $ payload -> sub ) ; if ( ! $ user ) { return false ; } unset ( $ user [ $ this -> _config [ 'fields' ] [ 'password' ] ] ) ; return $ user ; }
Get user record based on info available in JWT.

@param \Cake\Http\ServerRequest $request Request object.

@return bool|array User record array or false on failure.
Get user record based on info available in JWT .