<commit_before><?php

namespace Bolt\Extension\Bolt\Members\Oauth2\Handler;

use Bolt\Extension\Bolt\Members\AccessControl\Session;
use Bolt\Extension\Bolt\Members\Exception;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use Symfony\Component\HttpFoundation\Request;

/**
 * Remote OAuth2 client login provider.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class Remote extends HandlerBase
{
    /** @var AccessToken */
    protected $accessToken;
    /** @var ResourceOwnerInterface */
    protected $resourceOwner;

    /**
     * {@inheritdoc}
     */
    public function login(Request $request)
    {
        if (parent::login($request)) {
            return;
        }

        $providerName = $this->providerManager->getProviderName(true);
        $cookie = $request->cookies->get(Session::COOKIE_AUTHORISATION);
        $tokenEntities = $this->records->getTokensByCookie($cookie);

        foreach ($tokenEntities as $tokenEntity) {
            if ($tokenEntity) {
                $provider = $this->records->getProvision($tokenEntity->getGuid(), $providerName);
                if ($provider === false) {
                    continue;
                }
                $oauth = $this->records->getOauthByResourceOwnerId($provider->getResourceOwnerId());
                if ($oauth === false) {
                    continue;<commit_msg>Don't return base on parent response<commit_after><?php

namespace Bolt\Extension\Bolt\Members\Oauth2\Handler;

use Bolt\Extension\Bolt\Members\AccessControl\Session;
use Bolt\Extension\Bolt\Members\Exception;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use Symfony\Component\HttpFoundation\Request;

/**
 * Remote OAuth2 client login provider.
 *
 * Copyright (C) 2014-2016 <NAME>
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2014-2016, <NAME>
 * @license   https://opensource.org/licenses/MIT MIT
 */
class Remote extends HandlerBase
{
    /** @var AccessToken */
    protected $accessToken;
    /** @var ResourceOwnerInterface */
    protected $resourceOwner;

    /**
     * {@inheritdoc}
     */
    public function login(Request $request)
    {
        parent::login($request);

        $providerName = $this->providerManager->getProviderName(true);
        $cookie = $request->cookies->get(Session::COOKIE_AUTHORISATION);
        $tokenEntities = $this->records->getTokensByCookie($cookie);

        foreach ($tokenEntities as $tokenEntity) {
            if ($tokenEntity) {
                $provider = $this->records->getProvision($tokenEntity->getGuid(), $providerName);
                if ($provider === false) {
                    continue;
                }
                $oauth = $this->records->getOauthByResourceOwnerId($provider->getResourceOwnerId());
                if ($oauth === false) {
                    continue;
{'fraction_non_alphanumeric': 0.13209915280828366, 'fraction_numerical': 0.013178537809852526, 'mean_word_length': 2.8973105134474326, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 37, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3719213', 'n_tokens_mistral': 924, 'n_tokens_neox': 879, 'n_words': 162}