<commit_before>import { store } from './store'

export default (to, from, next) => {
  const auth = store.getters.keycloak
  const app = to.meta && to.meta.app
  if (to.matched.some(record => record.meta.edit)) {
    if (auth && auth.authenticated && store.getters.userRoles[app].edit) {
      // if token is expired, send user back to home
      // otherwise, continue to next route
      auth.isTokenExpired() ? next({ name: 'SearchHome' }) : next()
    } else {
      // no auth credentials
      next({ name: 'SearchHome' })
    }
  } else if (to.matched.some(record => record.meta.view)) {
    if (auth && auth.authenticated && store.getters.userRoless[app].view) {<commit_msg>fix typo in auth guard<commit_after>import { store } from './store'

export default (to, from, next) => {
  const auth = store.getters.keycloak
  const app = to.meta && to.meta.app
  if (to.matched.some(record => record.meta.edit)) {
    if (auth && auth.authenticated && store.getters.userRoles[app].edit) {
      // if token is expired, send user back to home
      // otherwise, continue to next route
      auth.isTokenExpired() ? next({ name: 'SearchHome' }) : next()
    } else {
      // no auth credentials
      next({ name: 'SearchHome' })
    }
  } else if (to.matched.some(record => record.meta.view)) {
    if (auth && auth.authenticated && store.getters.userRoles[app].view) {
{'fraction_non_alphanumeric': 0.15451895043731778, 'fraction_numerical': 0.0, 'mean_word_length': 3.002915451895044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7434196', 'n_tokens_mistral': 445, 'n_tokens_neox': 435, 'n_words': 118}