FOC\Authenticate\Auth\TokenAuthenticate::unauthenticated PHP Method

unauthenticated() public method

If unauthenticated, try to authenticate and respond.
public unauthenticated ( Cake\Network\Request $request, Response $response ) : boolean
$request Cake\Network\Request The request object.
$response Cake\Network\Response The response object.
return boolean False on failure, user on success.
    public function unauthenticated(Request $request, Response $response)
    {
        if ($this->_config['continue']) {
            return false;
        }
        if (is_string($this->_config['unauthorized'])) {
            // @codingStandardsIgnoreStart
            throw new $this->_config['unauthorized']();
            // @codingStandardsIgnoreEnd
        }
        $message = __d('authenticate', 'You are not authenticated.');
        throw new HttpException($message, $this->_config['unauthorized']);
    }