<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import Helmet from "react-helmet";
import axios from 'axios';
import { browserHistory } from 'react-router';


export default class Login extends React.Component {

    login(e) {
        e.preventDefault();
        axios({
            method: 'post',
            url: '/api-token-auth/',
            data: {
                'username': ReactDOM.findDOMNode(this.refs.username).value,
                'password': ReactDOM.findDOMNode(this.refs.password).value
            }
        }).then(function (response) {
            if (response.data['token']) {
                sessionStorage.setItem('token', response.data['token']);
                browserHistory.push('/dashboard/secret/');
            }
        })
            .catch(function (response) {
                sweetAlert("Oops!", response.data.non_field_errors[0], "error");
            });
    }

    render () {
        return <div className="login">
            <Helmet
                title="Hiren-Diary: Login"
                link={[
                    {"rel": "stylesheet", "href": "/static/css/login.css"},
                    {"rel": "icon", "href": "/static/favicon.ico"},
                    {"rel": "stylesheet", "type": "text/css", "href": "/static/css/sweetalert.css"}
                ]}
            />
            <form onSubmit={this.login.bind(this)}>

                <label>
                    <input type="text" required ref="username"/>
                    <div className="label-text">User name</div>
                </label>
                <label>
                    <input type="password" required ref="password"/>
                    <div className="label-text">Password</div>
                </label>
                <button className="button" type="submit" > Login </button>
            </form><commit_msg>fixed url<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import Helmet from "react-helmet";
import axios from 'axios';
import { browserHistory } from 'react-router';


export default class Login extends React.Component {

    login(e) {
        e.preventDefault();
        axios({
            method: 'post',
            url: '/api-token-auth/',
            data: {
                'username': ReactDOM.findDOMNode(this.refs.username).value,
                'password': ReactDOM.findDOMNode(this.refs.password).value
            }
        }).then(function (response) {
            if (response.data['token']) {
                sessionStorage.setItem('token', response.data['token']);
                browserHistory.push('/dashboard/');
            }
        })
            .catch(function (response) {
                sweetAlert("Oops!", response.data.non_field_errors[0], "error");
            });
    }

    render () {
        return <div className="login">
            <Helmet
                title="Hiren-Diary: Login"
                link={[
                    {"rel": "stylesheet", "href": "/static/css/login.css"},
                    {"rel": "icon", "href": "/static/favicon.ico"},
                    {"rel": "stylesheet", "type": "text/css", "href": "/static/css/sweetalert.css"}
                ]}
            />
            <form onSubmit={this.login.bind(this)}>

                <label>
                    <input type="text" required ref="username"/>
                    <div className="label-text">User name</div>
                </label>
                <label>
                    <input type="password" required ref="password"/>
                    <div className="label-text">Password</div>
                </label>
                <button className="button" type="submit" > Login </button>
            </form>
{'fraction_non_alphanumeric': 0.14936980423706087, 'fraction_numerical': 0.0005363368195226602, 'mean_word_length': 1.5993031358885017, 'pattern_counts': {'":': 14, '<': 35, '<?xml version=': 0, '>': 35, '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': '486053', 'n_tokens_mistral': 997, 'n_tokens_neox': 940, 'n_words': 194}