<commit_before>import React, {Component} from 'react';
import cookie from 'react-cookie';

import Header from '../components/modules/Header.jsx';
import {Link, PropTypes} from 'react-router';

const cookieAuthentication = 'cookieMonster';

class LoginPanel extends Component{
    constructor(props){
        super(props);

        this.state = {
            email: "",
            password: ""
        };
    }
    onChangeEmail(event){
        // Set the email state. It change everytime the onChange method fires in the input
        this.setState({'email': event.target.value});
    }

    onChangePassword(event){
        // Set the password state. It change everytime the onChange method fires in the input
        this.setState({'password': event.target.value});
    }

    onLogin(){
        // Take the email and password from the state in the React component
        const email = this.state.email;
        const password = this.<PASSWORD>;
        // Stupid test
        if (email === "nicola" && password === "password"){
            cookie.save(cookieAuthentication, 'thisisasecret');
        }
    }

    render(){
        return(
            <div className="container">
                <Header  />
                <h3>Login</h3>
                <form>
                email:<br/>
                <input type="text" name="email" onChange={this.onChangeEmail} />
                <br/>
                password:<br/>
                <input type="text" name="password" onChange={this.onChangePassword} />
                <br/>
                send login:<br/>
                <input type="submit" value="Submit" onClick={this.props.onLogin}/>
                </form>
            </div>
        );
    }
}

class LogoutPanel  extends Component{

    onLogout(event){
        // Remove the cookie when clicking the button
        cookie.remove(cookieAuthentication);
    }

    render(){
        return(
            <div className="container"><commit_msg>added new submit to remove secret cookie authentication<commit_after>import React, {Component} from 'react';
import cookie from 'react-cookie';

import Header from '../components/modules/Header.jsx';
import {Link, PropTypes} from 'react-router';

const cookieAuthentication = 'cookieMonster';

class LoginPanel extends Component{
    constructor(props){
        super(props);

        this.state = {
            email: "",
            password: ""
        };
    }
    onChangeEmail(event){
        // Set the email state. It change everytime the onChange method fires in the input
        this.setState({'email': event.target.value});
    }

    onChangePassword(event){
        // Set the password state. It change everytime the onChange method fires in the input
        this.setState({'password': event.target.value});
    }

    onLogin(){
        // Take the email and password from the state in the React component
        const email = this.state.email;
        const password = this.state.password;
        // Stupid test
        if (email === "nicola" && password === "password"){
            cookie.save(cookieAuthentication, 'thisisasecret');
        }
    }

    offLogin(){
        cookie.remove(cookieAuthentication, 'thisisasecret');
    }

    render(){
        return(
            <div className="container">
                <Header  />
                <h3>Login</h3>
                <form>
                email:<br/>
                <input type="text" name="email" onChange={this.onChangeEmail} />
                <br/>
                password:<br/>
                <input type="text" name="password" onChange={this.onChangePassword} />
                <br/>
                Sign In:<br/>
                <input type="submit" value="Login" onClick={this.props.onLogin}/>
                <br/>
                Sign Out:<br/>
                <input type="submit" value="Logout" onClick={this.props.offLogin}/>
                </form>
            </div>
        );
    }
}

class LogoutPanel  extends Component{

    onLogout(event){
        // Remove the cookie when clicking the button
        cookie.remove(cookieAuthentication);
    }

    render(){
        return(
            <div className="container">
{'fraction_non_alphanumeric': 0.12004773269689738, 'fraction_numerical': 0.0009546539379474941, 'mean_word_length': 1.876458476321208, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '2315561', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1064, 'n_words': 288}