<commit_before>logger = new Logger('routing')

Router.configure(
  layoutTemplate: 'layout'
)
Router.route('/', ->
  @render('explore')
)
Router.route('/account/forgotpassword', ->
  @render('forgotPassword')
,
  name: 'forgotPassword',
)
Router.route('/about', ->
  @render('about')
)
Router.route('/create', ->
  @render('create')
)
Router.route('/:owner/:project', ->
  @render("project")
,
  controller: ProjectController,
)
Router.onBeforeAction(->
  if !Meteor.userId()?
    logger.debug('User not logged in, rendering login page')
    @render('login')
  else
    if @url.startsWith('/account')
      curSection = "account"
    else if @url.startsWith("/create")
      curSection = "create"
    else if @url.startsWith("/about")
      curSection = "about"
    else
      curSection = "explore"
    Session.set("currentSection", curSection)

    logger.debug('User is authenticated')<commit_msg>Don't rely on String.startsWith<commit_after>logger = new Logger('routing')

Router.configure(
  layoutTemplate: 'layout'
)
Router.route('/', ->
  @render('explore')
)
Router.route('/account/forgotpassword', ->
  @render('forgotPassword')
,
  name: 'forgotPassword',
)
Router.route('/about', ->
  @render('about')
)
Router.route('/create', ->
  @render('create')
)
Router.route('/:owner/:project', ->
  @render("project")
,
  controller: ProjectController,
)
Router.onBeforeAction(->
  if !Meteor.userId()?
    logger.debug('User not logged in, rendering login page')
    @render('login')
  else
    if _.startsWith(@url, '/account')
      curSection = "account"
    else if _.startsWith(@url, "/create")
      curSection = "create"
    else if _.startsWith(@url, "/about")
      curSection = "about"
    else
      curSection = "explore"
    Session.set("currentSection", curSection)

    logger.debug('User is authenticated')
{'fraction_non_alphanumeric': 0.17788724685276408, 'fraction_numerical': 0.0, 'mean_word_length': 3.9945355191256833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '6679062', 'n_tokens_mistral': 582, 'n_tokens_neox': 587, 'n_words': 113}