<commit_before>namespace "Bixby.view", (exports, top) ->

  class exports.CheckGa extends Stark.View

    template: "main/check_ga"
    el: "div.body"


    events:
      "click button.check_token": (e) ->
        @check()

    check: ->
      gauth_token = @$("#gauth_token").val()
      $.ajax "/login/checkga",
        type: "POST",
        data: _.csrf({user: {tmpid: @tmpid, gauth_token: gauth_token}}),<commit_msg>handled token response<commit_after>namespace "Bixby.view", (exports, top) ->

  class exports.CheckGa extends Stark.View

    template: "main/check_ga"
    el: "div.body"


    events:
      "click button.check_token": (e) ->
        @check()

    check: ->
      gauth_token = @$("#gauth_token").val()

      view = @
      $.ajax "/login/checkga",
        type: "POST",
        data: _.csrf({user: {tmpid: @tmpid, gauth_token: gauth_token}}),
        success: (data, textStatus, jqXHR) ->
          ret = JSON.parse(data)

          # update csrf token
          $("meta[name='csrf-token']").attr('content', ret.csrf)

          Bixby.app.bootstrap_data.users = new Bixby.model.UserList().reset(ret.users)
          view.app.current_user = new Bixby.model.User(ret.user)

          if ret.redir && view.app.router.route(ret.redir) == true
            return

          if view.app.redir
            r = view.app.redir
            view.app.redir = null
            return view.app.transition r[0], r[1]

          # send to default route
          view.app.router.route(view.app.default_route)
{'fraction_non_alphanumeric': 0.15313531353135312, 'fraction_numerical': 0.0013201320132013201, 'mean_word_length': 2.225531914893617, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 10, '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': '4439237', 'n_tokens_mistral': 518, 'n_tokens_neox': 502, 'n_words': 99}