<commit_before>import React from 'react'
import classNames from 'classNames'
import { browserHistory, IndexLink, Link } from 'react-router'
import { inject, observer } from 'mobx-react'

@inject('sessionsStore')
@observer
export default class Root extends React.Component {
  
  componentDidMount() {
    this.checkAccessToken()
  }
  
  componentWillUpdate(nextProps, nextState) {
    this.checkAccessToken()
  }
  
  checkAccessToken() {
    let accessToken = this.props.sessionsStore.getAccessToken()
    let location = this.props.location.pathname
    if (accessToken == null) {
      // accessToken is null
      if (location != '/sign-in') {
        browserHistory.push('/sign-in')
      }
    } else {
      // accessToken is present
      if (location == '/sign-in') {
        browserHistory.push('/articles')
      }<commit_msg>Redirect to root after login, not articles<commit_after>import React from 'react'
import classNames from 'classNames'
import { browserHistory, IndexLink, Link } from 'react-router'
import { inject, observer } from 'mobx-react'

@inject('sessionsStore')
@observer
export default class Root extends React.Component {
  
  componentDidMount() {
    this.checkAccessToken()
  }
  
  componentWillUpdate(nextProps, nextState) {
    this.checkAccessToken()
  }
  
  checkAccessToken() {
    let accessToken = this.props.sessionsStore.getAccessToken()
    let location = this.props.location.pathname
    if (accessToken == null) {
      // accessToken is null
      if (location != '/sign-in') {
        browserHistory.push('/sign-in')
      }
    } else {
      // accessToken is present
      if (location == '/sign-in') {
        browserHistory.push('/')
      }
{'fraction_non_alphanumeric': 0.11858407079646018, 'fraction_numerical': 0.0, 'mean_word_length': 3.167076167076167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1429973', 'n_tokens_mistral': 492, 'n_tokens_neox': 487, 'n_words': 120}