<commit_before>var React = require('react'),
	auth = require('../Authentication/Auth.js');

var Login = React.createClass({

  contextTypes: {
    router: React.PropTypes.func
  },

  getInitialState: function () {
    return {
      error: false
    };
  },

  handleSubmit: function (event) {
    event.preventDefault();
    var { router } = this.context;
    var nextPath = router.getCurrentQuery().nextPath;
    var username = this.refs.username.getDOMNode().value;
    var pass = this.refs.pass.getDOMNode().value;

    auth.login(username, pass, function (loggedIn) {
      if (!loggedIn)
        return this.setState({ error: true });

      if (nextPath) {
        router.replaceWith(nextPath);
      } else {
        router.replaceWith('/');
      }
    }.bind(this));
  },

  render: function () {
    var errors = this.state.error ? <p>Bad login information</p> : '';
    
    return (
		<div className="login-card">
    		<h1>Log-in</h1><br/>
    		<form onSubmit={this.handleSubmit}>
    			<input ref="username" type="text" placeholder="username" defaultValue="marco" />
    			<input ref="pass" type="password" placeholder="password"/>
    			<input type="submit" name="login" className="login login-submit" value="login" />
    			{errors}
			</form>
		</div>
    );
  }
});

module.exports = Login;<commit_msg>changes to css in login<commit_after>var React = require('react'),
	auth = require('../Authentication/Auth.js');

var Login = React.createClass({

  contextTypes: {
    router: React.PropTypes.func
  },

  getInitialState: function () {
    return {
      error: false
    };
  },

  handleSubmit: function (event) {
    event.preventDefault();
    var { router } = this.context;
    var nextPath = router.getCurrentQuery().nextPath;
    var username = this.refs.username.getDOMNode().value;
    var pass = this.refs.pass.getDOMNode().value;

    auth.login(username, pass, function (loggedIn) {
      if (!loggedIn)
        return this.setState({ error: true });

      if (nextPath) {
        router.replaceWith(nextPath);
      } else {
        router.replaceWith('/');
      }
    }.bind(this));
  },

  render: function () {
    var errors = this.state.error ? <p>Bad login information</p> : '';
    
    return (
		<div className="login-card">
    		<h1>Log-in</h1><br/>
    		<form onSubmit={this.handleSubmit}>
    			<input ref="username" type="text" placeholder="username" defaultValue="marco" />
    			<input ref="pass" type="password" placeholder="password"/>
    			<input type="submit" name="login" className="login login-submit" value="login" />
    			{errors}
			</form>
		</div>
    );
  }
});


module.exports = Login;
{'fraction_non_alphanumeric': 0.1628517823639775, 'fraction_numerical': 0.00150093808630394, 'mean_word_length': 2.863768115942029, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '2984107', 'n_tokens_mistral': 868, 'n_tokens_neox': 837, 'n_words': 167}