<commit_before><?php
namespace MartinBean\Facebook\Laravel;

use Facebook\FacebookRedirectLoginHelper as BaseFacebookRedirectLoginHelper;
use Request;
use Session;

class FacebookRedirectLoginHelper extends BaseFacebookRedirectLoginHelper
{
    /**
     * Check if a redirect has a valid state.
     *
     * @return bool
     */
    protected function isValidRedirect()
    {
        return $this->getCode() && Request::get('state', null) == $this->state;
    }

    /**
     * Return the code.
     *
     * @return string|null
     */
    protected function getCode()
    {
        return Request::get('code', null);<commit_msg>Load the state before checking whether the state values match.<commit_after><?php
namespace MartinBean\Facebook\Laravel;

use Facebook\FacebookRedirectLoginHelper as BaseFacebookRedirectLoginHelper;
use Request;
use Session;

class FacebookRedirectLoginHelper extends BaseFacebookRedirectLoginHelper
{
    /**
     * Check if a redirect has a valid state.
     *
     * @return bool
     */
    protected function isValidRedirect()
    {
        $this->loadState();
        return $this->getCode() && Request::get('state', null) == $this->state;
    }

    /**
     * Return the code.
     *
     * @return string|null
     */
    protected function getCode()
    {
        return Request::get('code', null);
{'fraction_non_alphanumeric': 0.10828976848394324, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6183527', 'n_tokens_mistral': 366, 'n_tokens_neox': 355, 'n_words': 97}