<commit_before>import React, { Component } from 'react';
// react-router
import { Link } from 'react-router-dom';
// react-md
import {
  Button
} from 'react-md';
// axios
import axios from 'axios'
import { API_ROOT } from '../middleware/api'

class Accounts extends Component {
  constructor(props) {
    super(props)
    this.state = {
      dbResponse: 'error',
      dbAuthResponse: 'error'
    };
  }

  getDbResponse() {
    const url = `${API_ROOT}ping`;
    axios.get(url)
      .then(response => {
        console.log(response);
        this.setState({dbResponse: response.data})
        return response.data
      })
      .catch(error => {
        console.log(error);
        return error
      });
  }
  getDbAuthResponse() {
    const url = `${API_ROOT}secured/ping`;
    axios.get(url, { headers: { Authorization: `Bearer ${this.props.auth.getAccessToken()}` }})
      .then(response => {
        console.log(response);
        this.setState({dbAuthResponse: response.data})
        return response.data
      })
      .catch(error => {
        console.log(error);
        return error
      });
  }
  componentWillMount() {
    if (this.props.auth.isAuthenticated()){
      console.log('accessToken')
      console.log(this.props.auth.getAccessToken())
      this.getDbResponse()
      this.getDbAuthResponse()
    }
  }
  render(){
    const { isAuthenticated } = this.props.auth;
    const { dbResponse, dbAuthResponse } = this.state;
    console.log('Accounts')
    console.log(this.props.auth)
    console.log(isAuthenticated())
    return (
      <div className="md-text-container md-grid">
        <div className="md-cell md-cell--12">
          {!isAuthenticated()?
            <Link to={'/login'}>
              <Button flat primary label="Login / Register">input</Button>
            </Link>
            :<div>
              <p>dbResponse: {dbResponse}</p>
              <p>dbAuthResponse: {dbAuthResponse}</p>
              <Link to={'/logout'}>
                <Button flat primary label="Logout">input</Button>
              </Link>
            </div>
          }
        </div>
      </div>
    )
  }
}

export default Accounts
<commit_msg>CHANGE: have the Accounts page display no msgs by default<commit_after>import React, { Component } from 'react';
// react-router
import { Link } from 'react-router-dom';
// react-md
import {
  Button
} from 'react-md';
// axios
import axios from 'axios'
import { API_ROOT } from '../middleware/api'

class Accounts extends Component {
  constructor(props) {
    super(props)
    this.state = {
      dbResponse: '',
      dbAuthResponse: ''
    };
  }

  getDbResponse() {
    const url = `${API_ROOT}ping`;
    axios.get(url)
      .then(response => {
        console.log(response);
        this.setState({dbResponse: response.data})
        return response.data
      })
      .catch(error => {
        console.log(error);
        return error
      });
  }
  getDbAuthResponse() {
    const url = `${API_ROOT}secured/ping`;
    axios.get(url, { headers: { Authorization: `Bearer ${this.props.auth.getAccessToken()}` }})
      .then(response => {
        console.log(response);
        this.setState({dbAuthResponse: response.data})
        return response.data
      })
      .catch(error => {
        console.log(error);
        return error
      });
  }
  componentWillMount() {
    if (this.props.auth.isAuthenticated()){
      console.log('accessToken')
      console.log(this.props.auth.getAccessToken())
      this.getDbResponse()
      this.getDbAuthResponse()
    }
  }
  render(){
    const { isAuthenticated } = this.props.auth;
    const { dbResponse, dbAuthResponse } = this.state;
    console.log('Accounts')
    console.log(this.props.auth)
    console.log(isAuthenticated())
    return (
      <div className="md-text-container md-grid">
        <div className="md-cell md-cell--12">
          {!isAuthenticated()?
            <Link to={'/login'}>
              <Button flat primary label="Login / Register">input</Button>
            </Link>
            :<div>
              <p>dbResponse: {dbResponse}</p>
              <p>dbAuthResponse: {dbAuthResponse}</p>
              <Link to={'/logout'}>
                <Button flat primary label="Logout">input</Button>
              </Link>
            </div>
          }
        </div>
      </div>
    )
  }
}

export default Accounts

{'fraction_non_alphanumeric': 0.1480549199084668, 'fraction_numerical': 0.0009153318077803204, 'mean_word_length': 2.1812227074235806, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 47, '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': '5689637', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1341, 'n_words': 249}