<commit_before><?php

namespace fproject\authclient;

use fproject\authclient\OAuth2;
use Yii;

class HttpBasicAuth extends \yii\filters\auth\HttpBasicAuth
{
    /**
     * @inheritdoc
     */
    public function authenticate($user, $request, $response)
    {
        $authHeader = $request->getHeaders()->get('Authorization');
        if ($authHeader !== null && preg_match("/^Basic\\s+(.*?)$/", $authHeader, $matches)) {
            /** @var OAuth2|null $authClient */
            $authClient = OAuth2::getInstance();
            if($authClient)
            {
                /** @var String $authString */
                $authString = base64_encode($authClient->clientId . ":" . $authClient->clientSecret);
                if(strcmp($matches[1], $authString) == 0) {
                    return true;
                } else {
                    $this->handleFailure($response);
                }
            }
        }<commit_msg>Remove unused code<commit_after><?php

namespace fproject\authclient;

use Yii;

class HttpBasicAuth extends \yii\filters\auth\HttpBasicAuth
{
    /**
     * @inheritdoc
     */
    public function authenticate($user, $request, $response)
    {
        $authHeader = $request->getHeaders()->get('Authorization');
        if ($authHeader !== null && preg_match("/^Basic\\s+(.*?)$/", $authHeader, $matches)) {
            /** @var OAuth2|null $authClient */
            $authClient = OAuth2::getInstance();
            if($authClient)
            {
                /** @var String $authString */
                $authString = base64_encode($authClient->clientId . ":" . $authClient->clientSecret);
                if(strcmp($matches[1], $authString) == 0) {
                    return true;
                } else {
                    $this->handleFailure($response);
                }
            }
        }
{'fraction_non_alphanumeric': 0.15138361367335865, 'fraction_numerical': 0.00705371676614216, 'mean_word_length': 1.8589147286821706, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '1197034', 'n_tokens_mistral': 517, 'n_tokens_neox': 501, 'n_words': 88}